From a48034e0f7a7151160f1c6f5d92f356efb8fe321 Mon Sep 17 00:00:00 2001 From: Anton Pavlov Date: Thu, 22 Apr 2021 18:42:50 +0300 Subject: [PATCH] meshes squashed after changing anim state - fixed --- src/core/Animation.ts | 2 +- src/core/AnimationState.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/Animation.ts b/src/core/Animation.ts index 5a3ab937..6f6c2dfb 100644 --- a/src/core/Animation.ts +++ b/src/core/Animation.ts @@ -829,7 +829,7 @@ namespace pixi_spine.core { } 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)); } } diff --git a/src/core/AnimationState.ts b/src/core/AnimationState.ts index 02e779d0..062634a0 100644 --- a/src/core/AnimationState.ts +++ b/src/core/AnimationState.ts @@ -260,7 +260,7 @@ namespace pixi_spine.core { var slot = slots[i]; if (slot.attachmentState == setupState) { 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. @@ -378,7 +378,7 @@ namespace pixi_spine.core { } setAttachment (skeleton: Skeleton, slot: Slot, attachmentName: string, attachments: boolean) { - slot.attachment = attachmentName == null ? null : skeleton.getAttachment(slot.data.index, attachmentName); + slot.setAttachment(attachmentName == null ? null : skeleton.getAttachment(slot.data.index, attachmentName)); if (attachments) slot.attachmentState = this.unkeyedState + AnimationState.CURRENT; }