Skip to content
This repository has been archived by the owner on May 29, 2024. It is now read-only.

Commit

Permalink
fix for On Animation Name trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
MikalDev committed Jan 10, 2020
1 parent 5b766fd commit e6ae62e
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
Binary file added dist/Spine-v1.4.6.c3addon
Binary file not shown.
2 changes: 1 addition & 1 deletion src/addon.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "plugin",
"name": "Spine",
"id": "Gritsenko_Spine",
"version": "1.4.5.0",
"version": "1.4.6.0",
"author": "Igor Gritsenko",
"website": "https://www.gritsenko.biz",
"documentation": "https://www.construct.net",
Expand Down
2 changes: 1 addition & 1 deletion src/c3runtime/conditions.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},

OnAnimationFinished(animationName) {
return this.animationName == animationName;
return this.completeAnimationName == animationName;
},

OnAnyAnimationFinished() {
Expand Down
3 changes: 2 additions & 1 deletion src/c3runtime/instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
this.canvas = globalThis.c3_runtimeInterface.GetCanvas() // C3 canvas
this.spineFB = null
this.initSpineInProgress = false;
this.completeAnimationName = ""

const wi = this.GetWorldInfo();
// Enable collisions based on property, add ACEs if needed
Expand Down Expand Up @@ -282,6 +283,7 @@

state.tracks[0].listener = {
complete: (trackEntry, count) => {
this.completeAnimationName = this.animationName;
this.Trigger(C3.Plugins.Gritsenko_Spine.Cnds.OnAnimationFinished);
this.Trigger(C3.Plugins.Gritsenko_Spine.Cnds.OnAnyAnimationFinished);
}
Expand Down Expand Up @@ -509,7 +511,6 @@
this._newElementId = false;

var bounds = this.skeletonInfo.bounds;
console.log("creating dynamic texture with size: " + bounds.size.x + " x " + bounds.size.y);
this._elementTexture = renderer.CreateDynamicTexture(bounds.size.x, bounds.size.y, { mipMap: false });

var oldFrameBuffer = gl.getParameter(gl.FRAMEBUFFER_BINDING);
Expand Down
2 changes: 1 addition & 1 deletion src/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{

const PLUGIN_ID = "Gritsenko_Spine";
const PLUGIN_VERSION = "1.4.5.0";
const PLUGIN_VERSION = "1.4.6.0";
const PLUGIN_CATEGORY = "general";

const PLUGIN_CLASS = SDK.Plugins.Gritsenko_Spine = class SpinePlugin extends SDK.IPluginBase {
Expand Down

0 comments on commit e6ae62e

Please sign in to comment.