• Unity
  • Mix and Match Attachments

Hey there,

I'm super new to spine, I have just taken over a coworkers project and I have no idea where I am D:
we have a small avatar system that consists of several different skin colors and I would like to attach hairy, jewelry hats etc.
by selecting them in a menu.
the avatar system is using the canvas so everything is being done using the graphic not the animation so I have not found a lot of examples of what I am trying to do.
I don't know how long I have been at this but I can't figure out how to get the attachments to show up.

if anyone could point me in the right direction I would be super grateful!
thanks

Related Discussions
...
  • Изменено

My suggestion would be to start with a fresh Scene, fresh Canvas, and add your SkeletonGraphic to it, and test things out with that - this way you learn the basics of how to set the attachment/skin without any of your coworkers configuration/code adding to the complexity.

I haven't used SkeletonGraphic before, but I'm under the assumption that the code for setting skins/attachments would be the same (as it is for SkeletonAnimation).

Open the character you want to test it out with in Spine -> are you guys using Skins to configure how the character looks, or are you purely using attachments? If you don't know the difference, then you'll want to take a step back and do a bit of research on that.

If you're using Skins, here is the documentation for setting them through code: spine-unity Runtime Documentation: Setting Skins

And just above that section is the documentation for setting Attachments: spine-unity Runtime Documentation: Setting Attachments

Here is a link to a script I made that lets you set/add skins, which can be triggered through code and/or can be activated in Editor mode. It is set up for SkeletonAnimation but I assume you can just swap that for SkeletonGraphic. Note that this script requires Odin Inspector for some attributes (see note #2 in the post): Editor Multiple Skins Question


Ooo, had forgotten that another user had adapted my script and set it up for SkeletonGraphic - looks like they added a couple additional features too. Maybe check this out first: [suggestion] make default skin support combination.

Thanks for answering @Jamez0r! 8)

@[удалено]
As Jamez0r mentioned, you can interact with the SkeletonGraphic component just the same as with the SkeletonAnimation component regarding the Skeleton (skins, slots, attachments, and so on) and AnimationState (animation playback) API.

Aside from the spine-unity documentation sections mentioned by Jamez0r, you might want to check out the example scenes Spine Examples/Other Examples/Mix and Match, Mix and Match Equip and Mix and Match Skins that are included in the spine-unity unitypackage. While I'm not sure what exactly you are trying to achieve, you will likely find your topic covered in one of these three example scenes.