I would love to have official functions in spine-c that can serialize/deserialize an AnimationState into a portable binary format. This would be very helpful for my game which requires network synchronization of animations. :rock:
Right now the AnimationState variables are hidden in an internal struct. To work around this I redefined the _Internal struct in my own code and cast the AnimationState* into the _Internal struct so I can access its fields. This is obviously hacky but it is necessary to have access to the entire state of the AnimationState object for serialization. After gaining access, the serialization of AnimationState is straightforward because the fields are all float, int, or Animation* (which can be serialized based on the animation name).
Other alternatives I could currently use would be to modify the source code of the spine-c runtime or reimplement the functionality of AnimationState in my own class. However I prefer to avoid these solutions so that I can benefit from improvements to the spine-c runtime in the future.
Ultimately, having functions specifically for serialization/deserialization means that I can send the animation over the network with little effort, and Nate can still keep the AnimationState implementation internal if he feels that is advantageous.