mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +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;
|
Slot slot = constraint.target;
|
||||||
int slotIndex = slot.getData().index;
|
int slotIndex = slot.getData().index;
|
||||||
Bone slotBone = slot.bone;
|
Bone slotBone = slot.bone;
|
||||||
if (skin != null) {
|
if (skin != null) sortPathConstraintAttachment(skin, slotIndex, slotBone);
|
||||||
for (Entry<Key, Attachment> entry : skin.attachments.entries())
|
if (data.defaultSkin != null && data.defaultSkin != skin)
|
||||||
if (entry.key.slotIndex == slotIndex) sortPathConstraintAttachment(entry.value, slotBone);
|
sortPathConstraintAttachment(data.defaultSkin, slotIndex, slotBone);
|
||||||
}
|
|
||||||
for (int ii = 0, nn = data.skins.size; ii < nn; ii++)
|
for (int ii = 0, nn = data.skins.size; ii < nn; ii++)
|
||||||
for (Entry<Key, Attachment> entry : data.skins.get(i).attachments.entries())
|
sortPathConstraintAttachment(data.skins.get(ii), slotIndex, slotBone);
|
||||||
if (entry.key.slotIndex == slotIndex) sortPathConstraintAttachment(entry.value, slotBone);
|
|
||||||
|
|
||||||
Attachment attachment = slot.getAttachment();
|
Attachment attachment = slot.getAttachment();
|
||||||
if (attachment instanceof PathAttachment) sortPathConstraintAttachment(attachment, slotBone);
|
if (attachment instanceof PathAttachment) sortPathConstraintAttachment(attachment, slotBone);
|
||||||
@ -244,6 +242,11 @@ public class Skeleton {
|
|||||||
sortBone(bones.get(i));
|
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) {
|
private void sortPathConstraintAttachment (Attachment attachment, Bone slotBone) {
|
||||||
if (!(attachment instanceof PathAttachment)) return;
|
if (!(attachment instanceof PathAttachment)) return;
|
||||||
int[] pathBones = ((PathAttachment)attachment).getBones();
|
int[] pathBones = ((PathAttachment)attachment).getBones();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user