- Modifié
SetSkin opposite?
On SkeletonAnimation, you can set the skin using SetSkin, but is there some built in way to RemoveSkin? Or do I need to manually create one?
(So you use skin to set a hat on a character, then want to remove it..)
I used the SetSkin code as an example, but this seems to work:
var skeleton = skeletonAnimation.skeleton;
Skin dirt = skeletonData.FindSkin("Dirty");
foreach (var attachment in dirt.Attachments)
{
int slot_index = attachment.Key.slotIndex;
skeleton.slots.Items[slot_index].Attachment = null;
}
And turning on using the default method seems to work fine. Hopefully there isn't any unforeseen problems doing it that way.
Glad you found a solution, there shouldn't be any problems with this. We have a feature on our runtime roadmap that should make mixing and matching multiple skins easier, see [runtimes] Add API to create combined skin from multiple other skins · #841