Hello, I am working on creating a system for showing several skins at once and I could use some help. First I'll describe the setup I'm trying to achieve:
We have two base character silhouettes that we want to share one skeleton: a male character and a female character. We also have dozens of outfits that we want to be able to add to each character at runtime. We have a variety of hairstyles we want to be able to add at runtime as well.
This is the setup I am currently trying to create:
- Create two skins in Spine for the base animations: one for the male character and one for the female character.
- Create a skin for each outfit in Spine that goes on the same skeleton as the base skins
- In Unity create a new skin using the character skin as a base and add all the attachments from the outfit skin to the new skin.
- Use a placeholder slot for the hair that is a child of the head bone and attach the hairstyle sprites at runtime.
Now for the actual question! I'm currently hung up on the third part of the implementation: specifically creating a duplicate of one skin and adding another skin as new attachments on top of it. I have looked for ways to do this but I can't seem to find any. Everything I have found related to combining skins or mix and matching swaps out one image on an attachment for another, but I am looking to create a new skin that is the combination of two entire skins. The biggest issue I've run into is I can't seem to find a way to get all the attachments on a skeleton or a skin. I also can't find a way to see how many attachments are on a skin (otherwise I could just use a simple for loop and use GetAttachment). I could just tell the script how many slot indexes to loop over but if we decided to change the skeletons later then I have to update the code to match.
If anyone knows how to get around those issues or has a suggestion for another setup I can try I would really appreciate it!
Thanks,
Ceraph