浏览代码

Fixed submeshes.

One day this will work correctly. :(
NathanSweet 12 年之前
父节点
当前提交
64d50d5edc
共有 2 个文件被更改,包括 6 次插入2 次删除
  1. 3 1
      spine-tk2d/Assets/Spine/SkeletonComponent.cs
  2. 3 1
      spine-unity/Assets/Spine/SkeletonComponent.cs

+ 3 - 1
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.
 		// Allocate indexes if not the right size, allowing last submesh to have more than required.
 		int[] indexes = submesh.indexes;
 		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.indexes = indexes = new int[indexCount];
+			submesh.indexCount = 0;
+		}
 		
 		
 		// Set indexes if not already set.
 		// Set indexes if not already set.
 		if (submesh.firstVertex != vertexIndex || submesh.indexCount < indexCount) {
 		if (submesh.firstVertex != vertexIndex || submesh.indexCount < indexCount) {

+ 3 - 1
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.
 		// Allocate indexes if not the right size, allowing last submesh to have more than required.
 		int[] indexes = submesh.indexes;
 		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.indexes = indexes = new int[indexCount];
+			submesh.indexCount = 0;
+		}
 		
 		
 		// Set indexes if not already set.
 		// Set indexes if not already set.
 		if (submesh.firstVertex != vertexIndex || submesh.indexCount < indexCount) {
 		if (submesh.firstVertex != vertexIndex || submesh.indexCount < indexCount) {