[unity] Fix MeshGenerator unnecessarily disposing buffer objects.

This commit is contained in:
pharan 2018-10-18 21:14:54 +08:00 committed by GitHub
parent 89e85884df
commit 0fa7633ad1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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