Originally posted here: viewtopic.php?p=17418#p17418I'm leaving this info here since it's kind of an FAQ for people using Events.
These are in terms of C# since that's what I use and callback systems vary across different programming languages, but similar behavior on Spine's side can be found across all runtimes.
Spine.AnimationStateis where you subscribe to events:
Eventis for user-defined events that you key in Spine editor and is saved in Spine skeleton data.
Startis for whenever AnimationState starts playing a new
Endcan be a bit confusing though, so here's what they're really for (plus a warning):
Completeonly fires when an animation finishes playing to its full duration, and in the case of looping, in each loop.
- the end of each loop, and
- when an animation finishes playing.
Endfires when an animation finishes playing (not at every loop) but also when an Animation is changed or gets interrupted, even if it doesn't finish playing its full duration.
- when an animation finishes playing,
- when an animation is changed midway (SetAnimation can cause End to fire), or
- when an animation is stopped/cleared.
Because of this,
Endis a bit dangerous. You should never bind a function that calls
It'll do an infinite recursion (and cause a stack overflow) because SetAnimation causes
Endto fire when it interrupts a currently playing animation. It's fine to do it with
In some ways, it's a bit of a misnomer because
Endfires even if it doesn't reach the end of the animation.
A new and improved source of this information can be found here: Spine-Unity Events and Callbacks Documentation