• RuntimesUnity
  • [Unity] Correct way to loading a massive skeleton

Hello, everyone.
I have a project with many massive models with a .json around 7MB and 12 atlases. With time, they will get bigger and bigger.
Loading all these skeletons is painful for the user experience.
So, I want to preload several .json at the start of the game without any atlases, and when I need to show a skeleton on the screen, I load only atlases for the skeleton.
I think of making a dictionary with priority parameters for the skeletons to control which are often used and how many are loaded in the memory.
As I know, if I reload the skeleton to apply loaded atlases in materials, I need to load .json to the memory again to apply changes.
Any thoughts about optimization here? Do I have to reload .json every time I need to change the texture in the materials? Or maybe there are other ways to work around it?

I appreciate your help!

  • Harald がこの投稿に返信しました。
    Related Discussions
    ...

    Game Developer I have a project with many massive models with a .json around 7MB and 12 atlases. With time, they will get bigger and bigger.
    Loading all these skeletons is painful for the user experience.

    Instead of exporting your skeleton files as .json, you should in production only use binary export mode. The documentation mentions this here. This leads to smaller file size and reduced load times.

    Regarding 12 atlases, I assume you mean an atlas with 12 atlas page textures. If you don't want to load these textures when your skeleton is loaded, you could delay loading of the textures until the active attachments (and skins) require the respective texture. There is an experimental on-demand-loading UPM package available here which supports Addressables at the moment:
    EsotericSoftware/spine-runtimes1890
    The package swaps out your on-demand loaded high-resolution atlas textures with low-resolution counterparts as a pre-build step and downloads and replaces them when needed.

    Thank you for your response. I will try this way!

    • Harald が「いいね」しました。