[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:49:19 +08:00 committed by GitHub
parent c5413d32d0
commit ff31888adf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -866,12 +866,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];