mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-25 22:23:42 +08:00
Add Loop expression to determine if the current animation on the specified track is looping.
This commit is contained in:
parent
02ec69de27
commit
9b57f98260
@ -847,6 +847,19 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "loop",
|
||||
"expressionName": "Loop",
|
||||
"highlight": false,
|
||||
"returnType": "number",
|
||||
"params": [
|
||||
{
|
||||
"id": "track-index",
|
||||
"type": "number",
|
||||
"initial-value": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"id": "current-animation-start",
|
||||
"expressionName": "CurrentAnimationStart",
|
||||
|
||||
@ -119,6 +119,12 @@ C3.Plugins.EsotericSoftware_SpineConstruct3.Exps =
|
||||
return entry?.timeScale ?? 1;
|
||||
},
|
||||
|
||||
Loop (this: SpineC3Instance, track: number) {
|
||||
if (!this.state) return 0;
|
||||
const entry = this.state.getCurrent(track);
|
||||
return entry?.loop ? 1 : 0;
|
||||
},
|
||||
|
||||
CurrentAnimationStart (this: SpineC3Instance, trackIndex: number) {
|
||||
const track = this.state?.tracks[trackIndex];
|
||||
return track?.animationStart ?? 0;
|
||||
|
||||
@ -919,6 +919,16 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"loop": {
|
||||
"description": "Get whether the current animation on a track is set to loop (1 = looping, 0 = not looping).",
|
||||
"translated-name": "Loop",
|
||||
"params": {
|
||||
"track-index": {
|
||||
"name": "Track",
|
||||
"desc": "Track index."
|
||||
}
|
||||
}
|
||||
},
|
||||
"current-animation-start": {
|
||||
"description": "Get the start time of the current animation on the specified track.",
|
||||
"translated-name": "CurrentAnimationStart",
|
||||
|
||||
@ -919,6 +919,16 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"loop": {
|
||||
"description": "获取轨道上当前动画是否设置为循环(1 = 循环,0 = 不循环)。",
|
||||
"translated-name": "Loop",
|
||||
"params": {
|
||||
"track-index": {
|
||||
"name": "轨道",
|
||||
"desc": "轨道索引。"
|
||||
}
|
||||
}
|
||||
},
|
||||
"current-animation-start": {
|
||||
"description": "获取指定轨道上当前动画的开始时间。",
|
||||
"translated-name": "CurrentAnimationStart",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user