Hey,
I am having a lot of trouble with at runtime instantiated Spine-Animation Prefabs running into a null reference with AnimationState on iOS. I have tried two solutions.
Deferring all Animation-Calls to Start()
This helped with most of the cases, but there are still situations where I can run into a null reference on device.Deferring all Animation calls via Coroutine
I also tried to hack in a Coroutine, which checks the AnimationState reference per frame if it is still null, if not it starts the calls. However, I still can get a null Reference from the AnimationSate-Getter as well as sometimes having animations that never leave the coroutine (never get a non-null Animation State).
The funny thing is, the assets/prefabs seem to be ok, because some times they work, sometimes the become null at the same "place" in code as well as game-flow. We are using Skeletongraphics as well as SkeletonAnimations
Can you offer any help? When can AnimationState actually become/stay/be null? Would it be possible to have an "IsInitialized" Callback? I also noticed that the AnimationState is also null when entering OnEnable, which would be great improvement when using runtime instantiated Animations.
In Editor and on Android I do not have these kind of issues.