[unity] Fixed MeshGenerator not updating triangle indices when inactive bone implicitly clears attachment. See #1984.

This commit is contained in:
Harald Csaszar 2021-11-10 19:47:37 +01:00
parent 287825dab5
commit baf30f0ff5

View File

@ -180,7 +180,10 @@ namespace Spine.Unity {
var drawOrderItems = drawOrder.Items; var drawOrderItems = drawOrder.Items;
for (int i = 0; i < drawOrderCount; i++) { for (int i = 0; i < drawOrderCount; i++) {
Slot slot = drawOrderItems[i]; Slot slot = drawOrderItems[i];
if (!slot.bone.active) continue; if (!slot.bone.active) {
workingAttachmentsItems[i] = null;
continue;
}
Attachment attachment = slot.attachment; Attachment attachment = slot.attachment;
workingAttachmentsItems[i] = attachment; workingAttachmentsItems[i] = attachment;
@ -299,7 +302,10 @@ namespace Spine.Unity {
var drawOrderItems = drawOrder.Items; var drawOrderItems = drawOrder.Items;
for (int i = 0; i < drawOrderCount; i++) { for (int i = 0; i < drawOrderCount; i++) {
Slot slot = drawOrderItems[i]; Slot slot = drawOrderItems[i];
if (!slot.bone.active) continue; if (!slot.bone.active) {
workingAttachmentsItems[i] = null;
continue;
}
Attachment attachment = slot.attachment; Attachment attachment = slot.attachment;
#if SPINE_TRIANGLECHECK #if SPINE_TRIANGLECHECK
workingAttachmentsItems[i] = attachment; workingAttachmentsItems[i] = attachment;