• Unity
  • SkeletonAnimation "Reload" button loses Event data

  • Modificato
Related Discussions
...

Hey guys, sorry to post another thing so soon haha - I'm trying to improve the workflow for me and our animator, and just noticed that when you press "Reload" on the SkeletonAnimation component while running the game in the Editor, that all Event data seems to get lost (for that SkeletonAnimation instance, until restarting the game).

Is that a bug or intended behavior? The workflow I'm trying to set up is to run the game once in the Editor, and then make tweaks to animations/events, run an export script to update Unity, and then press Reload and test the tweaks (all without having to start/stop the game every time).

Thanks for the hint, we didn't know that. Admittedly the Reload functionality was not designed for reloading while in Play mode, but it would make sense.

We'll see if we can fix that, a compound issue ticket can be found here:
Skeleton Graphic does not have "Reload" buttons

Harald ha scritto

Admittedly the Reload functionality was not designed for reloading while in Play mode, but it would make sense.

Oh really? Whoops, I thought that was its primary purpose 😃 We have a setup going where we can run the game and put a character into a "test mode" and then trigger any of their abilities/attacks to see how the animation/mixing/etc looks - then on our 2nd monitor with Spine window make a tweak to any of the animations, run the export/import script, and press "Reload" and see the change immediately in-game. Its seriously awesome!

Thanks a lot for taking a look at it for me!

7 giorni dopo

Reason behind the problem was that the AnimationState member var of the SkeletonAnimation component is replaced by a new one when reloading. Any event subscribers previously have not been copied over to the new one.

A fix for this issue has just been pushed, the reload now no longer loses any event subscribers.
An updated 3.8 unitypackage can be downloaded here as usual: Spine Unity Download

Thanks for reporting!

Harald ha scritto

Reason behind the problem was that the AnimationState member var of the SkeletonAnimation component is replaced by a new one when reloading. Any event subscribers previously have not been copied over to the new one.

A fix for this issue has just been pushed, the reload now no longer loses any event subscribers.
An updated 3.8 unitypackage can be downloaded here as usual: Spine Unity Download

Thanks for reporting!

Yes, it works! The workflow is complete :grinteeth: :grinteeth: :grinteeth:

Thanks a ton, and special thanks for the easy to use SpineEditorUtilities.ReloadSkeletonDataAssetAndComponent function!

Glad it helped, thanks for letting us know! 8)