From 64d50d5edc789e30c9c097931923fc59907e10a2 Mon Sep 17 00:00:00 2001 From: NathanSweet Date: Thu, 3 Oct 2013 21:38:40 +0200 Subject: [PATCH] Fixed submeshes. One day this will work correctly. :( --- spine-tk2d/Assets/Spine/SkeletonComponent.cs | 4 +++- spine-unity/Assets/Spine/SkeletonComponent.cs | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/spine-tk2d/Assets/Spine/SkeletonComponent.cs b/spine-tk2d/Assets/Spine/SkeletonComponent.cs index f1bea215d..e3791d4ca 100644 --- a/spine-tk2d/Assets/Spine/SkeletonComponent.cs +++ b/spine-tk2d/Assets/Spine/SkeletonComponent.cs @@ -229,8 +229,10 @@ public class SkeletonComponent : MonoBehaviour { // Allocate indexes if not the right size, allowing last submesh to have more than required. int[] indexes = submesh.indexes; - if (lastSubmesh ? (indexes.Length < indexCount) : (indexes.Length != indexCount)) + if (lastSubmesh ? (indexes.Length < indexCount) : (indexes.Length != indexCount)) { submesh.indexes = indexes = new int[indexCount]; + submesh.indexCount = 0; + } // Set indexes if not already set. if (submesh.firstVertex != vertexIndex || submesh.indexCount < indexCount) { diff --git a/spine-unity/Assets/Spine/SkeletonComponent.cs b/spine-unity/Assets/Spine/SkeletonComponent.cs index 0634294a2..2703bbbb1 100644 --- a/spine-unity/Assets/Spine/SkeletonComponent.cs +++ b/spine-unity/Assets/Spine/SkeletonComponent.cs @@ -229,8 +229,10 @@ public class SkeletonComponent : MonoBehaviour { // Allocate indexes if not the right size, allowing last submesh to have more than required. int[] indexes = submesh.indexes; - if (lastSubmesh ? (indexes.Length < indexCount) : (indexes.Length != indexCount)) + if (lastSubmesh ? (indexes.Length < indexCount) : (indexes.Length != indexCount)) { submesh.indexes = indexes = new int[indexCount]; + submesh.indexCount = 0; + } // Set indexes if not already set. if (submesh.firstVertex != vertexIndex || submesh.indexCount < indexCount) {