mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-21 09:46:02 +08:00
Sequence attachment fixes.
This commit is contained in:
parent
f7ae127115
commit
d798334a5e
@ -878,22 +878,19 @@ public class SkeletonJson extends SkeletonLoader {
|
||||
}
|
||||
|
||||
// Attachment timelines.
|
||||
for (JsonValue deformMap = map.getChild("attachments"); deformMap != null; deformMap = deformMap.next) {
|
||||
Skin skin = skeletonData.findSkin(deformMap.name);
|
||||
if (skin == null) throw new SerializationException("Skin not found: " + deformMap.name);
|
||||
for (JsonValue slotMap = deformMap.child; slotMap != null; slotMap = slotMap.next) {
|
||||
for (JsonValue attachmentsMap = map.getChild("attachments"); attachmentsMap != null; attachmentsMap = attachmentsMap.next) {
|
||||
Skin skin = skeletonData.findSkin(attachmentsMap.name);
|
||||
if (skin == null) throw new SerializationException("Skin not found: " + attachmentsMap.name);
|
||||
for (JsonValue slotMap = attachmentsMap.child; slotMap != null; slotMap = slotMap.next) {
|
||||
SlotData slot = skeletonData.findSlot(slotMap.name);
|
||||
if (slot == null) throw new SerializationException("Slot not found: " + slotMap.name);
|
||||
for (JsonValue timelineMap = slotMap.child; timelineMap != null; timelineMap = timelineMap.next) {
|
||||
for (JsonValue attachmentMap = slotMap.child; attachmentMap != null; attachmentMap = attachmentMap.next) {
|
||||
Attachment attachment = skin.getAttachment(slot.index, attachmentMap.name);
|
||||
if (attachment == null) throw new SerializationException("Timeline attachment not found: " + attachmentMap.name);
|
||||
for (JsonValue timelineMap = attachmentMap.child; timelineMap != null; timelineMap = timelineMap.next) {
|
||||
JsonValue keyMap = timelineMap.child;
|
||||
if (keyMap == null) continue;
|
||||
|
||||
Attachment attachment = skin.getAttachment(slot.index, timelineMap.name);
|
||||
if (attachment == null) throw new SerializationException("Timeline attachment not found: " + timelineMap.name);
|
||||
|
||||
int frames = keyMap.size;
|
||||
String timelineName = keyMap.name;
|
||||
keyMap = keyMap.child;
|
||||
int frames = timelineMap.size;
|
||||
String timelineName = timelineMap.name;
|
||||
if (timelineName.equals("deform")) {
|
||||
VertexAttachment vertexAttachment = (VertexAttachment)attachment;
|
||||
boolean weighted = vertexAttachment.getBones() != null;
|
||||
@ -939,15 +936,16 @@ public class SkeletonJson extends SkeletonLoader {
|
||||
float lastDelay = 0;
|
||||
for (int frame = 0; keyMap != null; keyMap = keyMap.next, frame++) {
|
||||
float delay = keyMap.getFloat("delay", lastDelay);
|
||||
timeline.setFrame(frame, keyMap.getFloat("time", 0), SequenceMode.valueOf(keyMap.getString("mode", "stop")),
|
||||
keyMap.getInt("index", 0), delay);
|
||||
delay = lastDelay;
|
||||
timeline.setFrame(frame, keyMap.getFloat("time", 0),
|
||||
SequenceMode.valueOf(keyMap.getString("mode", "stop")), keyMap.getInt("index", 0), delay);
|
||||
lastDelay = delay;
|
||||
}
|
||||
timelines.add(timeline);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Draw order timeline.
|
||||
JsonValue drawOrdersMap = map.get("drawOrder");
|
||||
|
||||
@ -286,7 +286,7 @@ public class MeshAttachment extends VertexAttachment implements HasTextureRegion
|
||||
mesh.path = path;
|
||||
mesh.color.set(color);
|
||||
mesh.setParentMesh(parentMesh != null ? parentMesh : this);
|
||||
mesh.updateRegion();
|
||||
if (mesh.getRegion() != null) mesh.updateRegion();
|
||||
return mesh;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user