Explorar el Código

[unity] Fix MeshGenerator unnecessarily replacing buffer objects.

pharan hace 7 años
padre
commit
6dec3d37fa

+ 2 - 2
spine-unity/Assets/Spine/Runtime/spine-unity/Mesh Generation/SpineMesh.cs

@@ -457,10 +457,10 @@ namespace Spine.Unity {
 
 			if (submeshes.Count - 1 < submeshIndex) {
 				submeshes.Resize(submeshIndex + 1);
-				if (submeshes.Items[submeshIndex] == null)
-					submeshes.Items[submeshIndex] = new ExposedList<int>();
 			}
 			var submesh = submeshes.Items[submeshIndex];
+			if (submesh == null)
+				submeshes.Items[submeshIndex] = submesh = new ExposedList<int>();
 			submesh.Clear(false);
 
 			var skeleton = instruction.skeleton;