To address the issue of performance consumption by animations with a duration of 0 in your project, you can consider a strategy similar to what was discussed in the [spine-c] 3.5 - animation jerking context. Specifically, you can check if the animation's duration is 0 and, if so, avoid setting a new animation every frame or re-enabling the SkeletonAnimation
component unnecessarily. This approach aims to minimize unnecessary updates and performance overhead.
However, since you've encountered issues with updating to a new animation when the SkeletonAnimation
component is disabled, you might need to implement a more nuanced approach. One potential solution could be to only disable the SkeletonAnimation
component when you're certain that the animation with a duration of 0 will be playing for a while and re-enable it just before switching to a new animation. This could be done by monitoring the game state or the specific conditions under which animations are switched in your game.
Unfortunately, without direct support for this scenario in the Spine-Unity runtime, you may need to manually manage the enabling and disabling of the SkeletonAnimation
component based on your game's logic and the timing of animation switches. This approach requires careful consideration of the timing and conditions under which the component is enabled or disabled to ensure smooth transitions between animations.