mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
Add expressions for current animation start/end/last giving track index.
This commit is contained in:
parent
f825f3755b
commit
728186bb4f
@ -725,6 +725,42 @@
|
|||||||
"expressionName": "TimeScale",
|
"expressionName": "TimeScale",
|
||||||
"highlight": false,
|
"highlight": false,
|
||||||
"returnType": "number"
|
"returnType": "number"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "current-animation-start",
|
||||||
|
"expressionName": "CurrentAnimationStart",
|
||||||
|
"highlight": false,
|
||||||
|
"returnType": "number",
|
||||||
|
"params": [
|
||||||
|
{
|
||||||
|
"id": "track-index",
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "current-animation-end",
|
||||||
|
"expressionName": "CurrentAnimationEnd",
|
||||||
|
"highlight": false,
|
||||||
|
"returnType": "number",
|
||||||
|
"params": [
|
||||||
|
{
|
||||||
|
"id": "track-index",
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "current-animation-last",
|
||||||
|
"expressionName": "CurrentAnimationLast",
|
||||||
|
"highlight": false,
|
||||||
|
"returnType": "number",
|
||||||
|
"params": [
|
||||||
|
{
|
||||||
|
"id": "track-index",
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -83,5 +83,20 @@ C3.Plugins.EsotericSoftware_SpineConstruct3.Exps =
|
|||||||
|
|
||||||
TimeScale (this: SpineC3Instance) {
|
TimeScale (this: SpineC3Instance) {
|
||||||
return this.state?.timeScale ?? 1;
|
return this.state?.timeScale ?? 1;
|
||||||
|
},
|
||||||
|
|
||||||
|
CurrentAnimationStart (this: SpineC3Instance, trackIndex: number) {
|
||||||
|
const track = this.state?.tracks[trackIndex];
|
||||||
|
return track?.animationStart ?? 0;
|
||||||
|
},
|
||||||
|
|
||||||
|
CurrentAnimationEnd (this: SpineC3Instance, trackIndex: number) {
|
||||||
|
const track = this.state?.tracks[trackIndex];
|
||||||
|
return track?.animationEnd ?? 0;
|
||||||
|
},
|
||||||
|
|
||||||
|
CurrentAnimationLast (this: SpineC3Instance, trackIndex: number) {
|
||||||
|
const track = this.state?.tracks[trackIndex];
|
||||||
|
return track?.animationLast ?? 0;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -811,6 +811,36 @@
|
|||||||
"time-scale": {
|
"time-scale": {
|
||||||
"description": "Get the current animation time scale (speed multiplier).",
|
"description": "Get the current animation time scale (speed multiplier).",
|
||||||
"translated-name": "TimeScale"
|
"translated-name": "TimeScale"
|
||||||
|
},
|
||||||
|
"current-animation-start": {
|
||||||
|
"description": "Get the start time of the current animation on the specified track.",
|
||||||
|
"translated-name": "CurrentAnimationStart",
|
||||||
|
"params": {
|
||||||
|
"track-index": {
|
||||||
|
"name": "Track index",
|
||||||
|
"desc": "The track index"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"current-animation-end": {
|
||||||
|
"description": "Get the end time of the current animation on the specified track.",
|
||||||
|
"translated-name": "CurrentAnimationEnd",
|
||||||
|
"params": {
|
||||||
|
"track-index": {
|
||||||
|
"name": "Track index",
|
||||||
|
"desc": "The track index"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"current-animation-last": {
|
||||||
|
"description": "Get the last applied time of the current animation on the specified track.",
|
||||||
|
"translated-name": "CurrentAnimationLast",
|
||||||
|
"params": {
|
||||||
|
"track-index": {
|
||||||
|
"name": "Track index",
|
||||||
|
"desc": "The track index"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"custom_ui": {
|
"custom_ui": {
|
||||||
|
|||||||
@ -811,6 +811,36 @@
|
|||||||
"time-scale": {
|
"time-scale": {
|
||||||
"description": "获取当前动画时间缩放(速度倍数)。",
|
"description": "获取当前动画时间缩放(速度倍数)。",
|
||||||
"translated-name": "TimeScale"
|
"translated-name": "TimeScale"
|
||||||
|
},
|
||||||
|
"current-animation-start": {
|
||||||
|
"description": "获取指定轨道上当前动画的开始时间。",
|
||||||
|
"translated-name": "CurrentAnimationStart",
|
||||||
|
"params": {
|
||||||
|
"track-index": {
|
||||||
|
"name": "轨道索引",
|
||||||
|
"desc": "轨道索引"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"current-animation-end": {
|
||||||
|
"description": "获取指定轨道上当前动画的结束时间。",
|
||||||
|
"translated-name": "CurrentAnimationEnd",
|
||||||
|
"params": {
|
||||||
|
"track-index": {
|
||||||
|
"name": "轨道索引",
|
||||||
|
"desc": "轨道索引"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"current-animation-last": {
|
||||||
|
"description": "获取指定轨道上当前动画的最后应用时间。",
|
||||||
|
"translated-name": "CurrentAnimationLast",
|
||||||
|
"params": {
|
||||||
|
"track-index": {
|
||||||
|
"name": "轨道索引",
|
||||||
|
"desc": "轨道索引"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"custom_ui": {
|
"custom_ui": {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user