- Изменено
Steps to bring a skeleton back to setup pose?
Hello, I'm using object pooling in my game so I need to bring my skeleton back to setup pose manually since it will be resued.
These are the methods i've been using for ages:
skeleton.setBonesToSetupPose();
skeleton.setSlotsToSetupPose();
Yesterday I got a bug in my game and I found out I should also be clearing the track entries.
animationState.clearTracks();
Is there any other step involved that I'm missing?
You might need to remove any listeners you added to the AnimationState. Call AnimationState clearListeners
.
For the skeleton you can see what spine-libgdx's SkeletonActorPool does:
https://github.com/EsotericSoftware/spine-runtimes/blob/4.0/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/utils/SkeletonActorPool.java#L71-L87