[unity] Fix MeshGenerator unnecessarily disposing buffer objects.

This commit is contained in:
pharan 2018-10-18 21:37:24 +08:00
parent 8d74ef06ac
commit 27828048fb

View File

@ -455,9 +455,10 @@ namespace Spine.Unity {
public void AddSubmesh (SubmeshInstruction instruction, bool updateTriangles = true) {
var settings = this.settings;
if (submeshes.Count - 1 < submeshIndex) {
submeshes.Resize(submeshIndex + 1);
}
int newSubmeshCount = submeshIndex + 1;
if (submeshes.Items.Length < newSubmeshCount)
submeshes.Resize(newSubmeshCount);
submeshes.Count = newSubmeshCount;
var submesh = submeshes.Items[submeshIndex];
if (submesh == null)
submeshes.Items[submeshIndex] = submesh = new ExposedList<int>();