You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to disable or destroy an entity at the end of an animation. I either throws an error saying the skeleton cannot be null or keeps rendering the last frame of the animation.
SpineAnim.prototype.LoadSpine = function(entityName)
{
this.entity.spine.spine.skeleton.setSkinByName("default");
this.entity.spine.spine.skeleton.setSlotsToSetupPose();
this.entity.spine.states[1] = new spine.AnimationState(this.entity.spine.spine.stateData);
this.delegateObj = {
complete: this.onComplete.bind(this),
interrupt: this.onComplete.bind(this)
};
this.entity.spine.state.addListener(this.delegateObj);
this.entity.spine.state.defaultMix = 0.2;
this.entity.spine.state.addAnimation(0, "Idle", false);
};
SpineAnim.prototype.onComplete = function(track){
//this.entity.enabled = false <- doesnt work. continues to render last frame.
//this.entity.destroy(); <- throws an error saying skeleton cannot be null.
setTimeout(function(){this.entity.enabled = false;}.bind(this), 10); // <- works because it is outside of the on complete function.
};
The text was updated successfully, but these errors were encountered:
ChrisRegan
changed the title
Unable to disable or destroy entity on complete
Unable to disable or destroy entity in the complete callback
Aug 11, 2022
When trying to disable or destroy an entity at the end of an animation. I either throws an error saying the skeleton cannot be null or keeps rendering the last frame of the animation.
The text was updated successfully, but these errors were encountered: