Hi all!
I'm wondering if Is there a way to pause/resume animations OnBecane[In]visible with Unity runtimes.
In our current game almost all is done using spine animations, then there are hundreds of objects playing skeletal animations and the profiler shows that:
- SkeletonRenderer.LateUpdate() consumes between 40-45 % of time
- SkeletonAnimation.Update() consumes between 18-21 % of time
I think it would be useful to pause some animations, like coins for example, or maybe some enemies...
Any solution?
Thanks in advance!
Hello again!
I have made a quick and dirty test. I add two functions to SkeletonAnimation class:
public void OnBecameInvisible() {
valid = false;
}
public void OnBecameVisible() {
valid = true;
}
And now:
- SkeletonRenderer.LateUpdate() consumes between 12-14 % of time
- SkeletonAnimation.Update() consumes between 4-6 % of time
But I think that it should not be very safe to do so. What do you think?