[unity] Fix submesh count regression.

This also fixes tangents not being fully calculated when a skeleton uses no clipping and multiple submeshes.
This commit is contained in:
pharan 2018-11-15 10:47:10 +08:00 committed by GitHub
parent 8131c27440
commit 558a4b5e14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -862,12 +862,13 @@ namespace Spine.Unity {
this.meshBoundsMax = bmax; this.meshBoundsMax = bmax;
this.meshBoundsThickness = lastSlotIndex * settings.zSpacing; this.meshBoundsThickness = lastSlotIndex * settings.zSpacing;
int submeshInstructionCount = instruction.submeshInstructions.Count;
submeshes.Count = submeshInstructionCount;
// Add triangles // Add triangles
if (updateTriangles) { if (updateTriangles) {
int submeshInstructionCount = instruction.submeshInstructions.Count;
// Match submesh buffers count with submeshInstruction count. // Match submesh buffers count with submeshInstruction count.
if (this.submeshes.Count < submeshInstructionCount) { if (this.submeshes.Items.Length < submeshInstructionCount) {
this.submeshes.Resize(submeshInstructionCount); this.submeshes.Resize(submeshInstructionCount);
for (int i = 0, n = submeshInstructionCount; i < n; i++) { for (int i = 0, n = submeshInstructionCount; i < n; i++) {
var submeshBuffer = this.submeshes.Items[i]; var submeshBuffer = this.submeshes.Items[i];