Skip to content

Commit 52bd849

Browse files
committed
Add setDefaultMix action.
1 parent 921fc1d commit 52bd849

File tree

5 files changed

+48
-0
lines changed

5 files changed

+48
-0
lines changed

spine-ts/spine-construct3/src/aces.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,18 @@
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",

spine-ts/spine-construct3/src/c3runtime/actions.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff 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
},

spine-ts/spine-construct3/src/c3runtime/instance.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff 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) {

spine-ts/spine-construct3/src/lang/en-US.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,17 @@
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}",

spine-ts/spine-construct3/src/lang/zh-CN.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,17 @@
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}",

0 commit comments

Comments
 (0)