Skip to content

Commit 9b57f98

Browse files
committed
Add Loop expression to determine if the current animation on the specified track is looping.
1 parent 02ec69d commit 9b57f98

File tree

4 files changed

+39
-0
lines changed

4 files changed

+39
-0
lines changed

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -847,6 +847,19 @@
847847
}
848848
]
849849
},
850+
{
851+
"id": "loop",
852+
"expressionName": "Loop",
853+
"highlight": false,
854+
"returnType": "number",
855+
"params": [
856+
{
857+
"id": "track-index",
858+
"type": "number",
859+
"initial-value": 0
860+
}
861+
]
862+
},
850863
{
851864
"id": "current-animation-start",
852865
"expressionName": "CurrentAnimationStart",

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,12 @@ C3.Plugins.EsotericSoftware_SpineConstruct3.Exps =
119119
return entry?.timeScale ?? 1;
120120
},
121121

122+
Loop (this: SpineC3Instance, track: number) {
123+
if (!this.state) return 0;
124+
const entry = this.state.getCurrent(track);
125+
return entry?.loop ? 1 : 0;
126+
},
127+
122128
CurrentAnimationStart (this: SpineC3Instance, trackIndex: number) {
123129
const track = this.state?.tracks[trackIndex];
124130
return track?.animationStart ?? 0;

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -919,6 +919,16 @@
919919
}
920920
}
921921
},
922+
"loop": {
923+
"description": "Get whether the current animation on a track is set to loop (1 = looping, 0 = not looping).",
924+
"translated-name": "Loop",
925+
"params": {
926+
"track-index": {
927+
"name": "Track",
928+
"desc": "Track index."
929+
}
930+
}
931+
},
922932
"current-animation-start": {
923933
"description": "Get the start time of the current animation on the specified track.",
924934
"translated-name": "CurrentAnimationStart",

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -919,6 +919,16 @@
919919
}
920920
}
921921
},
922+
"loop": {
923+
"description": "获取轨道上当前动画是否设置为循环(1 = 循环,0 = 不循环)。",
924+
"translated-name": "Loop",
925+
"params": {
926+
"track-index": {
927+
"name": "轨道",
928+
"desc": "轨道索引。"
929+
}
930+
}
931+
},
922932
"current-animation-start": {
923933
"description": "获取指定轨道上当前动画的开始时间。",
924934
"translated-name": "CurrentAnimationStart",

0 commit comments

Comments
 (0)