diff --git a/dist/Spine-v1.7.0.c3addon b/dist/Spine-v1.7.0.c3addon new file mode 100644 index 0000000..3d06dd3 Binary files /dev/null and b/dist/Spine-v1.7.0.c3addon differ diff --git a/src/aces.json b/src/aces.json index a60d639..931312d 100644 --- a/src/aces.json +++ b/src/aces.json @@ -37,6 +37,17 @@ "id": "on-error", "scriptName": "OnError", "isTrigger": true + }, + { + "id": "on-event", + "scriptName": "OnEvent", + "isTrigger": true, + "params": [ + { + "id": "event-name", + "type": "string" + } + ] } ], "actions": [ diff --git a/src/addon.json b/src/addon.json index f236036..fc4f473 100755 --- a/src/addon.json +++ b/src/addon.json @@ -3,7 +3,7 @@ "type": "plugin", "name": "Spine", "id": "Gritsenko_Spine", - "version": "1.6.0", + "version": "1.7.0", "author": "Igor Gritsenko and Mikal", "website": "https://gritsenko.github.io/c3_spine_plugin", "documentation": "https://gritsenko.github.io/c3_spine_plugin", diff --git a/src/c3runtime/conditions.js b/src/c3runtime/conditions.js index a94fcba..99a2ec0 100644 --- a/src/c3runtime/conditions.js +++ b/src/c3runtime/conditions.js @@ -19,7 +19,9 @@ }, OnError() { return true; + }, + OnEvent(eventName) { + return this.completeEventName == eventName; } - }; } \ No newline at end of file diff --git a/src/c3runtime/instance.js b/src/c3runtime/instance.js index 1192d8c..6ff72fe 100644 --- a/src/c3runtime/instance.js +++ b/src/c3runtime/instance.js @@ -54,6 +54,7 @@ this.completeAnimationName = "" this.spineError = null this.animationSpeed = 1.0 + this.completeEventName = "" const wi = this.GetWorldInfo(); // Enable collisions based on property, add ACEs if needed @@ -293,6 +294,10 @@ this.completeAnimationName = this.animationName; this.Trigger(C3.Plugins.Gritsenko_Spine.Cnds.OnAnimationFinished); this.Trigger(C3.Plugins.Gritsenko_Spine.Cnds.OnAnyAnimationFinished); + }, + event: (trackIndex, event) => { + this.completeEventName = event.data.name; + this.Trigger(C3.Plugins.Gritsenko_Spine.Cnds.OnEvent); } }; @@ -469,6 +474,44 @@ Release() { super.Release(); + this.DEMO_NAME = null; + this.canvas = null; + this.bgColor = null; + this.isPlaying = null; + this.assetManager = null; + this.isSkeletonLoaded = null; + this.isSkeletonLoading = null; + this.isSpineInitialized = null; + this.skeletonInfo = null; + this.renderer = null; + this.gl = null; + this.atlasPath = null; + this.jsonPath = null; + this.atlasPath = null; + this.pngPath = null; + this.skinName = null; + this.animationName = null; + this.skeletonName = null; + this.skeletonScale = null; + this.premultipliedAlpha = null; + this.collisionsEnabled = null; + this.defaultMix = null; + this.isMirrored = null; + this._elementId = null; + this._elementTexture = null + this._newElementId = fnull; + this.pngURI = null; + this.atlasURI = null; + this.jsonURI = null; + this.c3renderer = null; + this.c3wgl = null; + this.canvas = null; + this.spineFB = null + this.initSpineInProgress = null; + this.completeAnimationName = null; + this.spineError = null + this.animationSpeed = null; + this.completeEventName = null; } Tick() { diff --git a/src/lang/en-US.json b/src/lang/en-US.json index a699f7e..133c725 100644 --- a/src/lang/en-US.json +++ b/src/lang/en-US.json @@ -90,6 +90,17 @@ "list-name": "On error", "display-text": "On error", "description": "Triggered on any spine error, error message in error expression." + }, + "on-event": { + "list-name": "On animation event", + "display-text": "On event {0}", + "description": "Triggered on specified animation event.", + "params": { + "event-name": { + "name": "Event name", + "desc": "Event name" + } + } } }, "actions": {