Thanks for sending your reproduction project, we received everything. The cause of your Complete
event not being fired is due to trackEntry.MixDuration
in the following code section:
TrackEntry trackEntry = SkeletonAnimation.state.AddAnimation(trackIndex, animation, loop, delay);
trackEntry.MixDuration = mixDuration;
If you only change trackEntry.MixDuration
without also updating trackEntry.Delay
, it keeps the transition start time (set via the delay one line earlier) as it was, essentially using your Default Mix Duration
of 0.2
set at the SkeletonDataAsset
. With an animation duration of 0.6, this sets the transition start time to 0.6 - 0.2 = 0.4. When you then change the MixDuration
to 0, it still starts, but now also ends the transition at 0.4, never reaching 0.6.
The corrected code section above would look like this:
TrackEntry trackEntry = SkeletonAnimation.state.SetAnimation(trackIndex, animation, loop);
trackEntry.MixDuration = mixDuration;
if (trackEntry.Previous != null)
trackEntry.Delay = trackEntry.Previous.TrackComplete - trackEntry.MixDuration;
You can find details about it here on the Spine Runtime API documentation page:
TrackEntry mixDuration