Add is skeleton loaded condition.

This commit is contained in:
Davide Tantillo 2025-11-04 17:05:39 +01:00
parent 2e37fb3855
commit 34bd5a1479
4 changed files with 22 additions and 4 deletions

View File

@ -33,6 +33,11 @@
"id": "is-flipped-x",
"scriptName": "IsFlippedX",
"isTrigger": false
},
{
"id": "is-skeleton-loaded",
"scriptName": "IsSkeletonLoaded",
"isTrigger": false
}
],
"actions": [

View File

@ -1,14 +1,14 @@
import type { SDKInstanceClass } from "./instance.ts";
import type { SDKInstanceClass as SpineC3Instance } from "./instance.ts";
const C3 = globalThis.C3;
C3.Plugins.EsotericSoftware_SpineConstruct3.Cnds =
{
OnSkeletonLoaded (this: SDKInstanceClass) {
OnSkeletonLoaded (this: SpineC3Instance) {
return true;
},
OnAnimationEvent (this: SDKInstanceClass, event: string, track: number, animation: string) {
OnAnimationEvent (this: SpineC3Instance, event: string, track: number, animation: string) {
console.log(this.triggeredEventName === event
&& this.triggeredEventTrack === track
&& this.triggeredEventAnimation === animation);
@ -16,7 +16,10 @@ C3.Plugins.EsotericSoftware_SpineConstruct3.Cnds =
&& this.triggeredEventTrack === track
&& this.triggeredEventAnimation === animation;
},
IsFlippedX (this: SDKInstanceClass) {
IsFlippedX (this: SpineC3Instance) {
return this.propFlipX;
},
IsSkeletonLoaded (this: SpineC3Instance) {
return this.skeletonLoaded;
},
};

View File

@ -103,6 +103,11 @@
"list-name": "Is flipped X",
"display-text": "Is flipped X",
"description": "Check if the skeleton is flipped horizontally"
},
"is-skeleton-loaded": {
"list-name": "Is skeleton loaded",
"display-text": "Is skeleton loaded",
"description": "Check if the skeleton has finished loading"
}
},
"actions": {

View File

@ -103,6 +103,11 @@
"list-name": "是否水平翻转",
"display-text": "是否水平翻转",
"description": "检查骨架是否水平翻转"
},
"is-skeleton-loaded": {
"list-name": "骨架是否已加载",
"display-text": "骨架是否已加载",
"description": "检查骨架是否已完成加载"
}
},
"actions": {