• RuntimesUnity
  • How to deal with very big Spine asset with a lot of skins and images?

I have a character Spine file with total 1400 skins now for customization clothes. It is now causing crashes due to out of memory on low-end devices, long loading time.
How can I resolve this?
I've used binary .skel instead of JSON, it has reduced the size somewhat and improved loading time.
I have to figure out how to load only the necessary atlas for displaying current equipped skins instead of every atlas associated with the Spine file.

Should I use Atlas Region Attacher? I still don't understand clearly what that does, I think I can separate atlas for each items type, for example, Dress items from the 1st - 20th will go to atlas dress_atlas_1, dress from the 21st - 40th go to dress_atlas_2... Therefore, if the character equipped dress 3, only dress_atlas_1 will be loaded. Do Atlas Region Attacher work that way?

    Related Discussions
    ...

    cdr9042 Do Atlas Region Attacher work that way?

    Using AtlasRegionAttacher won't solve your issue. The AtlasRegionAttacher example script only replaces one attachment of your normal skeleton skin with an attachment from a separate atlas, independent of your skeleton.

    What you need is to remove any (indirect) references to the atlas texture assets from your scene or prefabs, so that Unity does not automatically load these textures into memory. This is easiest to do at the skeleton's Materials. Then when actually needed, load these assets via e.g. Unity Addressables, Asset Bundles, and the like and hook them up at the Material again accordingly.

    We have an issue ticket here which deals with on-demand loading of atlas textures, unfortunately we didn't get to implement it yet.

    You can check out this forum thread for more details on the subject if you would like to implement a solution for your project in the meantime:
    https://esotericsoftware.com/forum/d/15867-memory-management-of-character-with-many-outfits/13