This problem should be caused by the excessive amount of mixed animations , There should be an upper limit on the number of mixed animations,This is a code design problem, and the js language also has this problem
CODE:
void Awake()
{
skeleton.timeScale = 0;
skeleton.AnimationState.GetCurrent(0).SetMixDuration(0.2f, 0);
}
public SkeletonGraphic skeleton;
public void Update()
{
for (int i = 0; i < 10; i++)
{
skeleton.AnimationState.SetAnimation(0, "animation", false);
}
}
ERROR:
StackOverflowException: The requested operation caused a stack overflow.
Spine.CurveTimeline1.GetRelativeValue (System.Single time, System.Single alpha, Spine.MixBlend blend, System.Single current, System.Single setup) (at Assets/Plugins/Spine/Runtime/spine-csharp/Animation.cs:449)
Spine.RotateTimeline.Apply (Spine.Skeleton skeleton, System.Single lastTime, System.Single time, Spine.ExposedList`1[T] firedEvents, System.Single alpha, Spine.MixBlend blend, Spine.MixDirection direction) (at Assets/Plugins/Spine/Runtime/spine-csharp/Animation.cs:575)
Spine.AnimationState.ApplyRotateTimeline (Spine.RotateTimeline timeline, Spine.Skeleton skeleton, System.Single time, System.Single alpha, Spine.MixBlend blend, System.Single[] timelinesRotation, System.Int32 i, System.Boolean firstFrame) (at Assets/Plugins/Spine/Runtime/spine-csharp/AnimationState.cs:522)
Spine.AnimationState.ApplyMixingFrom (Spine.TrackEntry to, Spine.Skeleton skeleton, Spine.MixBlend blend) (at Assets/Plugins/Spine/Runtime/spine-csharp/AnimationState.cs:427)
Spine.AnimationState.ApplyMixingFrom (Spine.TrackEntry to, Spine.Skeleton skeleton, Spine.MixBlend blend) (at Assets/Plugins/Spine/Runtime/spine-csharp/AnimationState.cs:358)
Spine.AnimationState.ApplyMixingFrom (Spine.TrackEntry to, Spine.Skeleton skeleton, Spine.MixBlend blend) (at Assets/Plugins/Spine/Runtime/spine-csharp/AnimationState.cs:358)
Spine.AnimationState.ApplyMixingFrom (Spine.TrackEntry to, Spine.Skeleton skeleton, Spine.MixBlend blend) (at Assets/Plugins/Spine/Runtime/spine-csharp/AnimationState.cs:358)
Spine.AnimationState.ApplyMixingFrom (Spine.TrackEntry to, Spine.Skeleton skeleton, Spine.MixBlend blend) (at Assets/Plugins/Spine/Runtime/spine-csharp/AnimationState.cs:358)
Sometimes, I need to use spine as a picture, so I set the time scale to 0, hoping to fix this problem