Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUGFIX: meshes squashed after changing anim state #385

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/core/Animation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/core/AnimationState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
}

Expand Down