[unity] Minor: refactoring, variable renamed.

This commit is contained in:
Harald Csaszar 2023-04-13 17:58:19 +02:00
parent 7d0833f881
commit 92728548b7

View File

@ -813,8 +813,8 @@ namespace Spine.Unity {
b2.x *= alpha;
b2.y = slot.Data.BlendMode == BlendMode.Additive ? 0 : alpha;
}
int meshVertexCount = meshAttachment.WorldVerticesLength;
for (int iii = 0; iii < meshVertexCount; iii += 2) {
int verticesArrayLength = meshAttachment.WorldVerticesLength;
for (int iii = 0; iii < verticesArrayLength; iii += 2) {
uv2i[vi] = rg;
uv3i[vi] = b2;
vi++;
@ -886,8 +886,8 @@ namespace Spine.Unity {
} else { //if (settings.renderMeshes) {
MeshAttachment meshAttachment = attachment as MeshAttachment;
if (meshAttachment != null) {
int meshVertexCount = meshAttachment.WorldVerticesLength;
if (tempVerts.Length < meshVertexCount) this.tempVerts = tempVerts = new float[meshVertexCount];
int verticesArrayLength = meshAttachment.WorldVerticesLength;
if (tempVerts.Length < verticesArrayLength) this.tempVerts = tempVerts = new float[verticesArrayLength];
meshAttachment.ComputeWorldVertices(slot, tempVerts);
if (settings.pmaVertexColors) {
@ -917,7 +917,7 @@ namespace Spine.Unity {
if (fy > bmax.y) bmax.y = fy;
}
for (int iii = 0; iii < meshVertexCount; iii += 2) {
for (int iii = 0; iii < verticesArrayLength; iii += 2) {
float x = tempVerts[iii], y = tempVerts[iii + 1];
vbi[vertexIndex].x = x; vbi[vertexIndex].y = y; vbi[vertexIndex].z = z;
cbi[vertexIndex] = color; ubi[vertexIndex].x = attachmentUVs[iii]; ubi[vertexIndex].y = attachmentUVs[iii + 1];