mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-19 16:26:40 +08:00
parent
6ed74bb6df
commit
94690dfd2e
@ -203,7 +203,7 @@ public class SkeletonJson {
|
|||||||
String path = map.getString("path", name);
|
String path = map.getString("path", name);
|
||||||
|
|
||||||
switch (AttachmentType.valueOf(map.getString("type", AttachmentType.region.name()))) {
|
switch (AttachmentType.valueOf(map.getString("type", AttachmentType.region.name()))) {
|
||||||
case region:
|
case region: {
|
||||||
RegionAttachment region = attachmentLoader.newRegionAttachment(skin, name, path);
|
RegionAttachment region = attachmentLoader.newRegionAttachment(skin, name, path);
|
||||||
if (region == null) return null;
|
if (region == null) return null;
|
||||||
region.setPath(path);
|
region.setPath(path);
|
||||||
@ -220,6 +220,7 @@ public class SkeletonJson {
|
|||||||
|
|
||||||
region.updateOffset();
|
region.updateOffset();
|
||||||
return region;
|
return region;
|
||||||
|
}
|
||||||
case boundingbox: {
|
case boundingbox: {
|
||||||
BoundingBoxAttachment box = attachmentLoader.newBoundingBoxAttachment(skin, name);
|
BoundingBoxAttachment box = attachmentLoader.newBoundingBoxAttachment(skin, name);
|
||||||
if (box == null) return null;
|
if (box == null) return null;
|
||||||
@ -245,11 +246,8 @@ public class SkeletonJson {
|
|||||||
mesh.setRegionUVs(map.require("uvs").asFloatArray());
|
mesh.setRegionUVs(map.require("uvs").asFloatArray());
|
||||||
mesh.updateUVs();
|
mesh.updateUVs();
|
||||||
|
|
||||||
//Check if color exists
|
String color = map.getString("color", null);
|
||||||
JsonValue meshColor = map.get("color");
|
if (color != null) mesh.getColor().set(Color.valueOf(color));
|
||||||
if(meshColor != null) {
|
|
||||||
mesh.getColor().set(Color.valueOf(meshColor.asString()));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (map.has("hull")) mesh.setHullLength(map.require("hull").asInt() * 2);
|
if (map.has("hull")) mesh.setHullLength(map.require("hull").asInt() * 2);
|
||||||
if (map.has("edges")) mesh.setEdges(map.require("edges").asIntArray());
|
if (map.has("edges")) mesh.setEdges(map.require("edges").asIntArray());
|
||||||
@ -282,6 +280,9 @@ public class SkeletonJson {
|
|||||||
mesh.setRegionUVs(uvs);
|
mesh.setRegionUVs(uvs);
|
||||||
mesh.updateUVs();
|
mesh.updateUVs();
|
||||||
|
|
||||||
|
String color = map.getString("color", null);
|
||||||
|
if (color != null) mesh.getColor().set(Color.valueOf(color));
|
||||||
|
|
||||||
if (map.has("hull")) mesh.setHullLength(map.require("hull").asInt() * 2);
|
if (map.has("hull")) mesh.setHullLength(map.require("hull").asInt() * 2);
|
||||||
if (map.has("edges")) mesh.setEdges(map.require("edges").asIntArray());
|
if (map.has("edges")) mesh.setEdges(map.require("edges").asIntArray());
|
||||||
mesh.setWidth(map.getFloat("width", 0) * scale);
|
mesh.setWidth(map.getFloat("width", 0) * scale);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user