[unity] Fixed renderer submesh cache.

This commit is contained in:
John 2016-09-19 18:53:39 +08:00 committed by GitHub
parent a67850cbe8
commit 9da5512b78

View File

@ -449,10 +449,12 @@ namespace Spine.Unity {
int oldSubmeshCount = submeshes.Count;
submeshes.Capacity = submeshCount;
if (submeshes.Capacity < submeshCount)
submeshes.Capacity = submeshCount;
for (int i = oldSubmeshCount; i < submeshCount; i++)
submeshes.Items[i] = new ArraysMeshGenerator.SubmeshTriangleBuffer(workingSubmeshInstructions.Items[i].triangleCount);
submeshes.Count = submeshCount;
var mutableTriangles = !workingInstruction.immutableTriangles;
for (int i = 0, last = submeshCount - 1; i < submeshCount; i++) {
var submeshInstruction = workingSubmeshInstructions.Items[i];