Hi, sorry if this question has been posted before, but I couldn't find it. When the player clicks the pause button in my game, I use the typical method to stop all logic:
Time.timeScale = 0f;
Unfortunately this causes certain spine animations to throw errors either immediately or when the game resumes. Is this a supported way of pausing all Spines? I am using spine-unity-3.8-2021-07-12.unitypackage with Unity editor 2020.3.16f1.
Just to give a quick example, I'm getting an Index out of Bounds in this AnimationState.BinarySearch():
internal static int BinarySearch (float[] values, float target) {
int low = 0;
int high = values.Length - 2;
if (high == 0) return 1;
int current = (int)((uint)high >> 1);
while (true) {
if (values[current + 1] <= target)
low = current + 1;
else
high = current;
if (low == high) return (low + 1);
current = (int)((uint)(low + high) >> 1);
}
}
On this line:
if (values[current + 1] <= target)
If I modify Skeleton Animation.Update() to the following:
void Update () {
#if UNITY_EDITOR
if (!Application.isPlaying) {
Update(0f);
return;
}
#endif
// NEW GUARD
if (Time.deltaTime <= 0.001f)
{
return;
}
Update(Time.deltaTime);
}
It seems to generally work better, but sometimes I get that same exception immediately on pause, or an NaN exception in ApplyRotateTimeline() upon resume or pause. Any help would be appreciated, thank you!