mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 17:56:04 +08:00
Add set-animation-mix.
This commit is contained in:
parent
e90d5d5d82
commit
3075b5b9b6
@ -207,10 +207,7 @@
|
|||||||
{
|
{
|
||||||
"id": "units",
|
"id": "units",
|
||||||
"type": "combo",
|
"type": "combo",
|
||||||
"items": [
|
"items": ["seconds", "ratio"]
|
||||||
"seconds",
|
|
||||||
"ratio"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "time",
|
"id": "time",
|
||||||
@ -221,6 +218,25 @@
|
|||||||
"type": "number"
|
"type": "number"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "set-animation-mix",
|
||||||
|
"scriptName": "SetAnimationMix",
|
||||||
|
"highlight": false,
|
||||||
|
"params": [
|
||||||
|
{
|
||||||
|
"id": "from-name",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "to-name",
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "duration",
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"expressions": [
|
"expressions": [
|
||||||
|
|||||||
@ -59,6 +59,10 @@ C3.Plugins.EsotericSoftware_SpineConstruct3.Acts =
|
|||||||
|
|
||||||
SetAnimationTime (this: SDKInstanceClass, units: 0 | 1, time: number, track: number) {
|
SetAnimationTime (this: SDKInstanceClass, units: 0 | 1, time: number, track: number) {
|
||||||
this.setAnimationTime(units, time, track);
|
this.setAnimationTime(units, time, track);
|
||||||
|
},
|
||||||
|
|
||||||
|
SetAnimationMix (this: SDKInstanceClass, fromName: string, toName: string, duration: number) {
|
||||||
|
this.setAnimationMix(fromName, toName, duration);
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@ -249,6 +249,17 @@ class SpineC3Instance extends globalThis.ISDKWorldInstanceBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public setAnimationMix (fromName: string, toName: string, duration: number) {
|
||||||
|
const stateData = this.state?.data;
|
||||||
|
if (!stateData) return;
|
||||||
|
|
||||||
|
try {
|
||||||
|
stateData.setMix(fromName, toName, duration);
|
||||||
|
} catch (error) {
|
||||||
|
console.error('[Spine] setAnimationMix error:', error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private _setSkin () {
|
private _setSkin () {
|
||||||
const { skeleton } = this;
|
const { skeleton } = this;
|
||||||
if (!skeleton) return;
|
if (!skeleton) return;
|
||||||
|
|||||||
@ -295,6 +295,25 @@
|
|||||||
"desc": "Track index"
|
"desc": "Track index"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"set-animation-mix": {
|
||||||
|
"list-name": "Set animation mix",
|
||||||
|
"display-text": "Set animation mix from {0} to {1} duration {2}",
|
||||||
|
"description": "Set the blend/crossfade duration when transitioning from one animation to another",
|
||||||
|
"params": {
|
||||||
|
"from-name": {
|
||||||
|
"name": "From animation",
|
||||||
|
"desc": "Name of the animation to transition from"
|
||||||
|
},
|
||||||
|
"to-name": {
|
||||||
|
"name": "To animation",
|
||||||
|
"desc": "Name of the animation to transition to"
|
||||||
|
},
|
||||||
|
"duration": {
|
||||||
|
"name": "Duration",
|
||||||
|
"desc": "Blend duration in seconds"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"expressions": {
|
"expressions": {
|
||||||
|
|||||||
@ -297,6 +297,25 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"set-animation-mix": {
|
||||||
|
"list-name": "设置动画混合",
|
||||||
|
"display-text": "设置从动画{0}到{1}的混合时长为{2}",
|
||||||
|
"description": "设置从一个动画过渡到另一个动画时的混合/淡入淡出时长",
|
||||||
|
"params": {
|
||||||
|
"from-name": {
|
||||||
|
"name": "起始动画",
|
||||||
|
"desc": "过渡起始的动画名称"
|
||||||
|
},
|
||||||
|
"to-name": {
|
||||||
|
"name": "目标动画",
|
||||||
|
"desc": "过渡目标的动画名称"
|
||||||
|
},
|
||||||
|
"duration": {
|
||||||
|
"name": "时长",
|
||||||
|
"desc": "混合时长(秒)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"expressions": {
|
"expressions": {
|
||||||
"double": {
|
"double": {
|
||||||
"description": "将数字翻倍。",
|
"description": "将数字翻倍。",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user