Nate wroteYou should not need to ask the skeleton what skins are selected. You should know what skins are selected, you assembled them into a single skin after all. Any time they select a new skin, clear the skin, add all the skins they have selected. There is no chance for that to be out of sync. It may be that your game state is simple enough that you want to just throw skins at the skeleton and be done, but for anything more complex, such as saving the items the user has selected, you don't want to use the skeleton to store that state.
Let's use this example:
You can equip Red Mohawk or Red Faux Hawk, but not both. You can equip Spiky Choker or No Necklace, but not both. When you equip one, it deselects the other in its slot. E.g., if you were wearing Red Mohawk and you wear Red Faux Hawk, you effectively unequipped Red Mohawk.
In Spine, I had to create slots to represent these concepts. But now, it feels like I have to do that all over again in my Unity code: As Harald said:
The setup would then be something like this:
base-skin= "caucasian character in underwear", "african character in underwear", ...
item-skin-earrings="normal earrings", "no earrings", "fancy diamond earrings"
Spine already knows exactly this information: e.g., That you can't wear "normal earrings" and "no earrings" at the same time because they share the same slots.
Now because I have to populate this "item-skin-earrings" list by hand (I think?), there's a good chance the Spine data and the Unity data will get out of sync. e.g., I could add a new kind of earring in spine and forget to add it to the list in unity. I could make a typo in one place and call it "no earings" instead of "no earrings," etc. If that happens, the item may not show up in this graphic, or the wardrobe may not know to unequip "no earrings" when you click "new earrings."
Anyway, this isn't a huge deal. I just gotta be sure to keep everything in sync. But IMO, if I could just ask the skeleton "Which skins are you wearing?" this would remove a set of potential mistakes I could make.
I may be thinking about this incorrectly! I'm very new to Spine. Let me know and thanks for your patience!
Any time they select a new skin, clear the skin, add all the skins they have selected. There is no chance for that to be out of sync.
I guess my main confusion is over this part. How do I know that when they select a new skin, that means they deselected another skin? e.g., Wearing "diamond earrings" means to deselect all other kinds of earrings? Is there any way to do that other than to write that information by hand in Unity code?