From baf30f0ff5fcdc5629323ea55f494e13ff2d5f27 Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Wed, 10 Nov 2021 19:47:37 +0100 Subject: [PATCH] [unity] Fixed MeshGenerator not updating triangle indices when inactive bone implicitly clears attachment. See #1984. --- .../spine-unity/Mesh Generation/MeshGenerator.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Mesh Generation/MeshGenerator.cs b/spine-unity/Assets/Spine/Runtime/spine-unity/Mesh Generation/MeshGenerator.cs index 1b1df877e..6827dc771 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Mesh Generation/MeshGenerator.cs +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Mesh Generation/MeshGenerator.cs @@ -180,7 +180,10 @@ namespace Spine.Unity { var drawOrderItems = drawOrder.Items; for (int i = 0; i < drawOrderCount; i++) { Slot slot = drawOrderItems[i]; - if (!slot.bone.active) continue; + if (!slot.bone.active) { + workingAttachmentsItems[i] = null; + continue; + } Attachment attachment = slot.attachment; workingAttachmentsItems[i] = attachment; @@ -299,7 +302,10 @@ namespace Spine.Unity { var drawOrderItems = drawOrder.Items; for (int i = 0; i < drawOrderCount; i++) { Slot slot = drawOrderItems[i]; - if (!slot.bone.active) continue; + if (!slot.bone.active) { + workingAttachmentsItems[i] = null; + continue; + } Attachment attachment = slot.attachment; #if SPINE_TRIANGLECHECK workingAttachmentsItems[i] = attachment;