mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 22:34:53 +08:00
Check default skin, fixed crash.
This commit is contained in:
parent
92d7ef32f4
commit
ae4ac8210f
@ -197,13 +197,11 @@ public class Skeleton {
|
||||
Slot slot = constraint.target;
|
||||
int slotIndex = slot.getData().index;
|
||||
Bone slotBone = slot.bone;
|
||||
if (skin != null) {
|
||||
for (Entry<Key, Attachment> entry : skin.attachments.entries())
|
||||
if (entry.key.slotIndex == slotIndex) sortPathConstraintAttachment(entry.value, slotBone);
|
||||
}
|
||||
if (skin != null) sortPathConstraintAttachment(skin, slotIndex, slotBone);
|
||||
if (data.defaultSkin != null && data.defaultSkin != skin)
|
||||
sortPathConstraintAttachment(data.defaultSkin, slotIndex, slotBone);
|
||||
for (int ii = 0, nn = data.skins.size; ii < nn; ii++)
|
||||
for (Entry<Key, Attachment> entry : data.skins.get(i).attachments.entries())
|
||||
if (entry.key.slotIndex == slotIndex) sortPathConstraintAttachment(entry.value, slotBone);
|
||||
sortPathConstraintAttachment(data.skins.get(ii), slotIndex, slotBone);
|
||||
|
||||
Attachment attachment = slot.getAttachment();
|
||||
if (attachment instanceof PathAttachment) sortPathConstraintAttachment(attachment, slotBone);
|
||||
@ -244,6 +242,11 @@ public class Skeleton {
|
||||
sortBone(bones.get(i));
|
||||
}
|
||||
|
||||
private void sortPathConstraintAttachment (Skin skin, int slotIndex, Bone slotBone) {
|
||||
for (Entry<Key, Attachment> entry : skin.attachments.entries())
|
||||
if (entry.key.slotIndex == slotIndex) sortPathConstraintAttachment(entry.value, slotBone);
|
||||
}
|
||||
|
||||
private void sortPathConstraintAttachment (Attachment attachment, Bone slotBone) {
|
||||
if (!(attachment instanceof PathAttachment)) return;
|
||||
int[] pathBones = ((PathAttachment)attachment).getBones();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user