Hey, I'm working on a directional animation manager for c#/Unity that will allow me to have multiple SkeletalAnimations and switch them on or off based on the direction the GameObject is facing. (This is for a top-down game.)
In order to do this, I'm thinking of getting all the current TrackEntry data from the AnimationState which is being switched off when the game object changes direction, and adding tracks with the same animation name to the new AnimationState, as well as synchronizing all the track state.
The problem I'm running into is that I can't iterate over the current TrackEntrys in AnimationState.tracks. AnimationState.tracks itself is private, and GetCurrent(trackIndex) can return null whether or not you're at the end of the track list, because entries within the list can be null. I could check a certain number of trackIndexes every time I'm going through, and deal with the non-null ones, but that's hacky! Is there a nice way I can iterate over the tracks? Is there a better way to synchronize AnimationStates I'm completely missing?
Thanks for reading
Spine is so good!
Alex
p.s. I know this is a small detail to be worried about 🙂 I'm hoping to build something that doesn't break whenever a new runtime is released. Just a getter for the current count on the tracks list would do what I need, or a getter for the list itself, which you might not want to expose.