|
@@ -175,6 +175,10 @@ namespace Spine.Unity {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public MeshGenerator () {
|
|
|
+ submeshes.TrimExcess();
|
|
|
+ }
|
|
|
+
|
|
|
#region Step 1 : Generate Instructions
|
|
|
public static void GenerateSingleSubmeshInstruction (SkeletonRendererInstruction instructionOutput, Skeleton skeleton, Material material) {
|
|
|
ExposedList<Slot> drawOrder = skeleton.drawOrder;
|
|
@@ -866,12 +870,13 @@ namespace Spine.Unity {
|
|
|
this.meshBoundsMax = bmax;
|
|
|
this.meshBoundsThickness = lastSlotIndex * settings.zSpacing;
|
|
|
|
|
|
+ int submeshInstructionCount = instruction.submeshInstructions.Count;
|
|
|
+ submeshes.Count = submeshInstructionCount;
|
|
|
+
|
|
|
// Add triangles
|
|
|
if (updateTriangles) {
|
|
|
- int submeshInstructionCount = instruction.submeshInstructions.Count;
|
|
|
-
|
|
|
// Match submesh buffers count with submeshInstruction count.
|
|
|
- if (this.submeshes.Count < submeshInstructionCount) {
|
|
|
+ if (this.submeshes.Items.Length < submeshInstructionCount) {
|
|
|
this.submeshes.Resize(submeshInstructionCount);
|
|
|
for (int i = 0, n = submeshInstructionCount; i < n; i++) {
|
|
|
var submeshBuffer = this.submeshes.Items[i];
|