[ts] Fixed assigning attachment to slot

This commit is contained in:
Luke Ingram 2022-01-20 17:53:47 -04:00
parent 1aa112fe40
commit 72f3ad3fb0
2 changed files with 2 additions and 2 deletions

View File

@ -829,7 +829,7 @@ module spine {
} }
setAttachment(skeleton: Skeleton, slot: Slot, attachmentName: string) { setAttachment(skeleton: Skeleton, slot: Slot, attachmentName: string) {
slot.attachment = attachmentName == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName); slot.setAttachment(attachmentName == null ? null : skeleton.getAttachment(this.slotIndex, attachmentName));
} }
} }

View File

@ -260,7 +260,7 @@ module spine {
var slot = slots[i]; var slot = slots[i];
if (slot.attachmentState == setupState) { if (slot.attachmentState == setupState) {
var attachmentName = slot.data.attachmentName; var attachmentName = slot.data.attachmentName;
slot.attachment = (attachmentName == null ? null : skeleton.getAttachment(slot.data.index, attachmentName)); slot.setAttachment(attachmentName == null ? null : skeleton.getAttachment(slot.data.index, attachmentName));
} }
} }
this.unkeyedState += 2; // Increasing after each use avoids the need to reset attachmentState for every slot. this.unkeyedState += 2; // Increasing after each use avoids the need to reset attachmentState for every slot.