mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
Fixed Skin#copySkin to take into account parent meshes.
This commit is contained in:
parent
ff5b854860
commit
f1e199b2bd
@ -81,10 +81,19 @@ public class Skin {
|
|||||||
|
|
||||||
for (SkinEntry entry : skin.attachments.keys()) {
|
for (SkinEntry entry : skin.attachments.keys()) {
|
||||||
Attachment attachment = entry.getAttachment().copy();
|
Attachment attachment = entry.getAttachment().copy();
|
||||||
if (attachment instanceof MeshAttachment) {
|
|
||||||
}
|
|
||||||
setAttachment(entry.getSlotIndex(), entry.getName(), attachment);
|
setAttachment(entry.getSlotIndex(), entry.getName(), attachment);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (SkinEntry entry : attachments.keys()) {
|
||||||
|
Attachment attachment = entry.getAttachment();
|
||||||
|
if (attachment instanceof MeshAttachment) {
|
||||||
|
MeshAttachment mesh = (MeshAttachment)attachment;
|
||||||
|
if (mesh.getParentMesh() != null) {
|
||||||
|
mesh.setParentMesh((MeshAttachment)getAttachment(entry.getSlotIndex(), mesh.getParentMesh().getName()));
|
||||||
|
mesh.updateUVs();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns the attachment for the specified slot index and name, or null. */
|
/** Returns the attachment for the specified slot index and name, or null. */
|
||||||
|
|||||||
@ -278,8 +278,10 @@ public class MeshAttachment extends VertexAttachment {
|
|||||||
}
|
}
|
||||||
copy.width = width;
|
copy.width = width;
|
||||||
copy.height = height;
|
copy.height = height;
|
||||||
} else
|
} else {
|
||||||
copy.setParentMesh(parentMesh);
|
copy.setParentMesh(parentMesh);
|
||||||
|
copy.updateUVs();
|
||||||
|
}
|
||||||
|
|
||||||
return copy;
|
return copy;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user