ggzerosum

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?
ggzerosum
  • Mesajlar: 11

Nate

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.
Kullanıcı avatarı
Nate

Nate
  • Mesajlar: 11939

ggzerosum

Nate yazdı: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.
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;
}
}
ggzerosum
  • Mesajlar: 11


Dön Runtimes