• Unity
  • Skeleton Graphic WebGL performance issues

  • Змінено
Related Discussions
...

Is this normal?

Latest Spine.
Unity 2019.2.13
Runtimes from November 25th
Profiling done on a live WebGL build in my Chromium based browser

The object itself is part of the scene and is loaded in disabled. The script then enables the skeleton graphic asset when clicking a UI button. The spike in the profiler only appears on enabling the skeleton graphic for the first time. Any following disabling/enabling of the asset is buttery smooth.

The allocations in SkeletonGraphic.Awake() are normal as it has to load all bones and timelines once.

Unfortunately, when having the GameObject disabled, Unity will not call Awake() until it is enabled - which is not what you want most of the time. So a workaround around this behaviour could either be to start with the GameObject enabled and disable it immediately in a Start() call. Another workaround would be to disable the SkeletonGraphic component (and other components), as this does indeed call Awake() as opposed to a disabled GameObject. We are sorry that this is a bit clumsy, I don't really understand why Unity has come up with this design decision.

5 днів пізніше

Thank you for the information. We did as you suggested having all skeletons enabled on load and disable them after. Thanks!

Thanks for getting back to us!