Hi,
I recently migrated my project from spine 3.8 to spine 4.0 everything went relatively smoothly so that is awesome.
However, I noticed something different. I'm using Unity timeline and at the end of my timelines I always add an idle clip with "loop" set to true in order for the character to get back to idle.
Prior to the migration, the idle would keep looping after the timeline director was finished playing. But now the character just freezes.
The animation on the skeletonAnimation is correctly set with the right animation and "loop" is ticked, but the animation just doesn't play.
I noticed that checking "don't pause with director" on the Animation State Clip fixes this, but what if I do want my animations to pause with the director? I suppose that's where the bug comes from, the clip probably thinks the director is paused. I can workaround the problem using that flag but it is a bit of a hacky way to deal with it and would require me to edit every single one of my timelines.
edit:
I did some research, and it appears OnBehaviourPause is indeed called when the director becomes inactive (which includes getting at the end of the graph)
https://forum.unity.com/threads/code-example-how-to-detect-the-end-of-the-playable-clip.659617/
so in SpineAnimationStateMixerBehaviour.cs you could fix this like so:
public override void OnBehaviourPause (Playable playable, FrameData info)
{
var duration = playable.GetDuration();
var count = playable.GetTime() + info.deltaTime;
if ((info.effectivePlayState == PlayState.Paused && count > duration) || playable.GetGraph().GetRootPlayable(0).IsDone())
return;
if (!dontPauseWithDirector) {
if (!isPaused)
HandlePause(playable);
isPaused = true;
}
}
I've tested the modification in my project and that solved it, but I suppose you guys might want to test it more thoroughly (or perhaps that was the intended behaviour all along, if that's the case I'd love to know).