[unity] Fix MeshGenerator unnecessarily replacing buffer objects.

This commit is contained in:
pharan 2018-10-17 22:18:06 +08:00
parent 554c5f0cf5
commit 6dec3d37fa

View File

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