mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-07 11:16:53 +08:00
Add setDefaultMix action.
This commit is contained in:
parent
921fc1dad9
commit
52bd849fdc
@ -316,6 +316,18 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "set-default-mix",
|
||||
"scriptName": "SetDefaultMix",
|
||||
"highlight": false,
|
||||
"params": [
|
||||
{
|
||||
"id": "duration",
|
||||
"type": "number",
|
||||
"initial-value": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "set-physics-mode",
|
||||
"scriptName": "SetPhysicsMode",
|
||||
|
||||
@ -97,6 +97,10 @@ C3.Plugins.EsotericSoftware_SpineConstruct3.Acts =
|
||||
this.setAnimationMix(fromName, toName, duration);
|
||||
},
|
||||
|
||||
SetDefaultMix (this: SDKInstanceClass, duration: number) {
|
||||
this.setDefaultMix(duration);
|
||||
},
|
||||
|
||||
SetPhysicsMode (this: SDKInstanceClass, mode: 0 | 1 | 2 | 3) {
|
||||
this.setPhysicsMode(mode);
|
||||
},
|
||||
|
||||
@ -616,6 +616,16 @@ class SpineC3Instance extends globalThis.ISDKWorldInstanceBase {
|
||||
}
|
||||
}
|
||||
|
||||
public setDefaultMix (duration: number) {
|
||||
const stateData = this.state?.data;
|
||||
if (!stateData) {
|
||||
console.warn('[Spine] setDefaultMix: no state data');
|
||||
return;
|
||||
}
|
||||
|
||||
stateData.defaultMix = duration;
|
||||
}
|
||||
|
||||
public setTrackAlpha (alpha: number, trackIndex: number) {
|
||||
const { state } = this;
|
||||
if (!state) {
|
||||
|
||||
@ -398,6 +398,17 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"set-default-mix": {
|
||||
"list-name": "Set default mix",
|
||||
"display-text": "Set default mix duration to {0}",
|
||||
"description": "Set the default crossfade duration used when transitioning between animations that don't have a specific mix defined",
|
||||
"params": {
|
||||
"duration": {
|
||||
"name": "Duration",
|
||||
"desc": "Default blend duration in seconds"
|
||||
}
|
||||
}
|
||||
},
|
||||
"set-physics-mode": {
|
||||
"list-name": "Set physics mode",
|
||||
"display-text": "Set physics mode to {0}",
|
||||
|
||||
@ -398,6 +398,17 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"set-default-mix": {
|
||||
"list-name": "设置默认混合",
|
||||
"display-text": "设置默认混合时长为{0}",
|
||||
"description": "设置动画过渡时使用的默认混合时长(当没有为特定动画对定义混合时长时使用)",
|
||||
"params": {
|
||||
"duration": {
|
||||
"name": "时长",
|
||||
"desc": "默认混合时长(秒)"
|
||||
}
|
||||
}
|
||||
},
|
||||
"set-physics-mode": {
|
||||
"list-name": "设置物理模式",
|
||||
"display-text": "设置物理模式为{0}",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user