I make animation hiding attachment on certain frame. And I want to know the way to detect whether attachment is hide or not.
(That two image show animation frame hiding attachment.)
Is it possible or should i create my own way?
I make animation hiding attachment on certain frame. And I want to know the way to detect whether attachment is hide or not.
(That two image show animation frame hiding attachment.)
Is it possible or should i create my own way?
To see if an attachment is hidden for a slot, you get the slot (Skeleton findSlot
) and check if the attachment is null (Slot attachment
). Note each attachment can be in multiple slots at runtime, so you are actually checking the slot.
Nate написалTo see if an attachment is hidden for a slot, you get the slot (Skeleton
findSlot
) and check if the attachment is null (Slotattachment
). Note each attachment can be in multiple slots at runtime, so you are actually checking the slot.
Thank you! It works like charm.
For the future reference, I will post my code snippet here.
public static class CustomSpineExtension
{
public static bool IsAttachmentHided(this Skeleton skeleton, string slotName)
{
return skeleton.FindSlot(slotName).Attachment == null;
}
public static bool IsAttachmentHided(this Slot slot)
{
return slot.Attachment == null;
}
}