• RuntimesUnity
  • How to combine skins from different Spine files in Unity6?

Hi everyone,

I’m using the Spine Unity Runtime and I have a question about mixing skins.

I have a character (say Spineboy) that comes with a few skins — for example, some hats, body armors, and some tools. Now I’ve created another version of the same character in a second Spine file, with new hats, new body armors, etc.

What I’d like to do is mix these parts — for example, use the hat from the first file with the armor from the second one, and create custom combinations in Unity at runtime.

Is this possible? Can I combine skins or attachments from two different Spine files? Or do I need to rework everything into a single file inside Spine?

I’m trying to keep each Spine file small and modular, so I can add new skins to the game in the future without having to re-export everything each time.
Would this kind of modular setup have any impact on performance? Any tips or warnings would be helpful.

If there’s a recommended workflow for this (like sharing skin placeholders between projects, etc.), I’d really appreciate the help.

Thanks!

Related Discussions
...

To combine skins from different Spine files in Unity, you can use the Spine Unity Runtime's capabilities to mix and match skins at runtime. You can achieve this by using the Skin.addSkin() method to combine skins from different skeletons. First, ensure that both skeletons have compatible setups, meaning they should have the same bone and slot structure. You can then create a new skin in Unity and add the desired skins from each file to this new skin. After combining the skins, you can apply the combined skin to your skeleton using the Skeleton.setSkin() method.

For performance considerations, using multiple smaller files can be beneficial as it allows for more modular updates and potentially reduces the need to re-export everything when changes are made. However, be mindful of the number of draw calls, as combining skins from different files may lead to additional draw calls if they use different materials. You can mitigate this by using runtime repacking to combine textures into a single atlas, which reduces draw calls.

For a recommended workflow, consider using skin placeholders in your Spine projects to ensure compatibility and ease of combining skins. This approach allows you to maintain a modular setup while still being able to mix and match parts from different files.