2025-11-14 12:34:37 +01:00

30 lines
958 B
TypeScript

import type { SDKInstanceClass as SpineC3Instance } from "./instance.ts";
const C3 = globalThis.C3;
C3.Plugins.EsotericSoftware_SpineConstruct3.Cnds =
{
OnSkeletonLoaded (this: SpineC3Instance) {
return true;
},
OnAnimationEvent (this: SpineC3Instance, event: string, track: number, animation: string) {
const eventMatches = event === "" || this.triggeredEventName === event;
const trackMatches = track === -1 || this.triggeredEventTrack === track;
const animationMatches = animation === "" || this.triggeredEventAnimation === animation;
return eventMatches && trackMatches && animationMatches;
},
IsFlippedX (this: SpineC3Instance) {
return this.isFlippedX;
},
IsSkeletonLoaded (this: SpineC3Instance) {
return this.skeletonLoaded;
},
IsPlaying (this: SpineC3Instance) {
return this.isPlaying;
},
IsInsideSlot (this: SpineC3Instance, x: number, y: number, slotName: string) {
return this.isInsideSlot(x, y, slotName);
},
};