File tree Expand file tree Collapse file tree 5 files changed +48
-0
lines changed
spine-ts/spine-construct3/src Expand file tree Collapse file tree 5 files changed +48
-0
lines changed Original file line number Diff line number Diff line change 316316 }
317317 ]
318318 },
319+ {
320+ "id" : " set-default-mix" ,
321+ "scriptName" : " SetDefaultMix" ,
322+ "highlight" : false ,
323+ "params" : [
324+ {
325+ "id" : " duration" ,
326+ "type" : " number" ,
327+ "initial-value" : 0
328+ }
329+ ]
330+ },
319331 {
320332 "id" : " set-physics-mode" ,
321333 "scriptName" : " SetPhysicsMode" ,
Original file line number Diff line number Diff line change @@ -97,6 +97,10 @@ C3.Plugins.EsotericSoftware_SpineConstruct3.Acts =
9797 this . setAnimationMix ( fromName , toName , duration ) ;
9898 } ,
9999
100+ SetDefaultMix ( this : SDKInstanceClass , duration : number ) {
101+ this . setDefaultMix ( duration ) ;
102+ } ,
103+
100104 SetPhysicsMode ( this : SDKInstanceClass , mode : 0 | 1 | 2 | 3 ) {
101105 this . setPhysicsMode ( mode ) ;
102106 } ,
Original file line number Diff line number Diff line change @@ -616,6 +616,16 @@ class SpineC3Instance extends globalThis.ISDKWorldInstanceBase {
616616 }
617617 }
618618
619+ public setDefaultMix ( duration : number ) {
620+ const stateData = this . state ?. data ;
621+ if ( ! stateData ) {
622+ console . warn ( '[Spine] setDefaultMix: no state data' ) ;
623+ return ;
624+ }
625+
626+ stateData . defaultMix = duration ;
627+ }
628+
619629 public setTrackAlpha ( alpha : number , trackIndex : number ) {
620630 const { state } = this ;
621631 if ( ! state ) {
Original file line number Diff line number Diff line change 398398 }
399399 }
400400 },
401+ "set-default-mix" : {
402+ "list-name" : " Set default mix" ,
403+ "display-text" : " Set default mix duration to {0}" ,
404+ "description" : " Set the default crossfade duration used when transitioning between animations that don't have a specific mix defined" ,
405+ "params" : {
406+ "duration" : {
407+ "name" : " Duration" ,
408+ "desc" : " Default blend duration in seconds"
409+ }
410+ }
411+ },
401412 "set-physics-mode" : {
402413 "list-name" : " Set physics mode" ,
403414 "display-text" : " Set physics mode to {0}" ,
Original file line number Diff line number Diff line change 398398 }
399399 }
400400 },
401+ "set-default-mix" : {
402+ "list-name" : " 设置默认混合" ,
403+ "display-text" : " 设置默认混合时长为{0}" ,
404+ "description" : " 设置动画过渡时使用的默认混合时长(当没有为特定动画对定义混合时长时使用)" ,
405+ "params" : {
406+ "duration" : {
407+ "name" : " 时长" ,
408+ "desc" : " 默认混合时长(秒)"
409+ }
410+ }
411+ },
401412 "set-physics-mode" : {
402413 "list-name" : " 设置物理模式" ,
403414 "display-text" : " 设置物理模式为{0}" ,
You can’t perform that action at this time.
0 commit comments