From 11055a22e49afd67f3cf27f4573caccaf77897b4 Mon Sep 17 00:00:00 2001 From: NathanSweet Date: Fri, 16 May 2014 19:43:57 +0200 Subject: [PATCH] Fixed mesh attachment using the slot vertices length. --- spine-csharp/src/Attachments/MeshAttachment.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spine-csharp/src/Attachments/MeshAttachment.cs b/spine-csharp/src/Attachments/MeshAttachment.cs index 8060a0604..033afab1b 100644 --- a/spine-csharp/src/Attachments/MeshAttachment.cs +++ b/spine-csharp/src/Attachments/MeshAttachment.cs @@ -96,8 +96,9 @@ namespace Spine { y += bone.worldY; float m00 = bone.m00, m01 = bone.m01, m10 = bone.m10, m11 = bone.m11; float[] vertices = this.vertices; - if (slot.attachmentVerticesCount == vertices.Length) vertices = slot.AttachmentVertices; - for (int i = 0, n = vertices.Length; i < n; i += 2) { + int verticesCount = vertices.Length; + if (slot.attachmentVerticesCount == verticesCount) vertices = slot.AttachmentVertices; + for (int i = 0; i < verticesCount; i += 2) { float vx = vertices[i]; float vy = vertices[i + 1]; worldVertices[i] = vx * m00 + vy * m01 + x;