mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
Clean up.
This commit is contained in:
parent
04c0fec844
commit
5623631026
@ -220,12 +220,9 @@ namespace Spine {
|
||||
if (mesh == null) return null;
|
||||
|
||||
mesh.Path = path;
|
||||
float[] uvs = GetFloatArray(map, "uvs", 1);
|
||||
int[] triangles = GetIntArray(map, "triangles");
|
||||
float[] vertices = GetFloatArray(map, "vertices", Scale);
|
||||
mesh.vertices = vertices;
|
||||
mesh.triangles = triangles;
|
||||
mesh.regionUVs = uvs;
|
||||
mesh.vertices = GetFloatArray(map, "vertices", Scale);
|
||||
mesh.triangles = GetIntArray(map, "triangles");
|
||||
mesh.regionUVs = GetFloatArray(map, "uvs", 1);
|
||||
mesh.UpdateUVs();
|
||||
|
||||
if (map.ContainsKey("color")) {
|
||||
@ -249,8 +246,6 @@ namespace Spine {
|
||||
|
||||
mesh.Path = path;
|
||||
float[] uvs = GetFloatArray(map, "uvs", 1);
|
||||
int[] triangles = GetIntArray(map, "triangles");
|
||||
|
||||
float[] vertices = GetFloatArray(map, "vertices", 1);
|
||||
var weights = new List<float>(uvs.Length * 3 * 3);
|
||||
var bones = new List<int>(uvs.Length * 3);
|
||||
@ -268,7 +263,7 @@ namespace Spine {
|
||||
}
|
||||
mesh.bones = bones.ToArray();
|
||||
mesh.weights = weights.ToArray();
|
||||
mesh.triangles = triangles;
|
||||
mesh.triangles = GetIntArray(map, "triangles");
|
||||
mesh.regionUVs = uvs;
|
||||
mesh.UpdateUVs();
|
||||
|
||||
|
||||
@ -205,17 +205,14 @@ public class SkeletonJson {
|
||||
MeshAttachment mesh = attachmentLoader.newMeshAttachment(skin, name, path);
|
||||
if (mesh == null) return null;
|
||||
mesh.setPath(path);
|
||||
float[] uvs = map.require("uvs").asFloatArray();
|
||||
short[] triangles = map.require("triangles").asShortArray();
|
||||
|
||||
float[] vertices = map.require("vertices").asFloatArray();
|
||||
if (scale != 1) {
|
||||
for (int i = 0, n = vertices.length; i < n; i++)
|
||||
vertices[i] *= scale;
|
||||
}
|
||||
mesh.setVertices(vertices);
|
||||
mesh.setTriangles(triangles);
|
||||
mesh.setRegionUVs(uvs);
|
||||
mesh.setTriangles(map.require("triangles").asShortArray());
|
||||
mesh.setRegionUVs(map.require("uvs").asFloatArray());
|
||||
mesh.updateUVs();
|
||||
|
||||
if (map.has("hull")) mesh.setHullLength(map.require("hull").asInt() * 2);
|
||||
@ -229,8 +226,6 @@ public class SkeletonJson {
|
||||
if (mesh == null) return null;
|
||||
mesh.setPath(path);
|
||||
float[] uvs = map.require("uvs").asFloatArray();
|
||||
short[] triangles = map.require("triangles").asShortArray();
|
||||
|
||||
float[] vertices = map.require("vertices").asFloatArray();
|
||||
FloatArray weights = new FloatArray(uvs.length * 3 * 3);
|
||||
IntArray bones = new IntArray(uvs.length * 3);
|
||||
@ -247,7 +242,7 @@ public class SkeletonJson {
|
||||
}
|
||||
mesh.setBones(bones.toArray());
|
||||
mesh.setWeights(weights.toArray());
|
||||
mesh.setTriangles(triangles);
|
||||
mesh.setTriangles(map.require("triangles").asShortArray());
|
||||
mesh.setRegionUVs(uvs);
|
||||
mesh.updateUVs();
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user