Hey Pharan.
I mean, honestly nothing is stopping me from unsubscribing at death, or anything else that might happen mid attack. I'm just worried that that's a rabbit hole that might never end, depending on animations and characters. Example, what if enemies can be teleported or something, that's a new thing that can interrupt the attack, and the more things that get introduced, is just more things to have to try to remember, for any enemy that it might happen to basically.
You're right, I think I am tangling myself up, especially with character states sometimes depending on animation and vice versa. In this particular case though, if the attack animation is playing and it dies, I immediately set the character state to dead, but the problem is that the attack complete event still occurs while the dying animation is playing. So variable resets that happen when attack completes assumes that the character is still alive. So again, yeah I can just do a check in the animation complete if the character is still alive, but still feels like a fix, and not the "right" way if that makes sense?
Another question, can you clarify at different points in an animation cycle, when would I want to use the trackEntry.animation.name vs the skeletonAnimation.AnimationName. i.e. when setting an animation and I don't want set it if it's already playing, I know I can check the skeleton, but in complete events, when should I check the skeleton and when should I check the trackEntry. Like in that attack complete callback in my original post, using one gives a different result than the other.
Thanks once again Pharan. As usual, you are my saviour!
08 Sep 2017, 14:36
Another quick question on top of all the others :S
Is there any way to have a complete event not fire after it's been "interrupted". And I say interrupted with quotes, because what I really mean is, I call SetAnimation("Attack"), and then before it's done, I can call SetAnimation("Die"), and it plays the death animation, it stays dead (invisible), but I still get the attack complete event. I get that the event fires after every loop, that's fine, but when it's not "playing", is there a way to have it not fire anymore besides manually removing the listener when changing the event.
Thanks!