From 68595c439dfedf4433d9921fed54fcb7726cab8b Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Mon, 17 Feb 2020 16:19:59 +0100 Subject: [PATCH] [unity] Fixed clipping masks not always working on additional atlas pages, when clipping end slot is first submesh attachment. Closes #1618. --- .../spine-unity/Mesh Generation/MeshGenerator.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 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 571879a4e..ceff89ccd 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 @@ -302,11 +302,6 @@ namespace Spine.Unity { } } - if (clippingEndSlot != null && slot.data == clippingEndSlot && i != clippingAttachmentSource) { - clippingEndSlot = null; - clippingAttachmentSource = -1; - } - // Create a new SubmeshInstruction when material changes. (or when forced to separate by a submeshSeparator) // Slot with a separator/new material will become the starting slot of the next new instruction. if (hasSeparators) { //current.forceSeparate = hasSeparators && separatorSlots.Contains(slot); @@ -381,6 +376,11 @@ namespace Spine.Unity { totalRawVertexCount += attachmentVertexCount; #endif } + + if (clippingEndSlot != null && slot.data == clippingEndSlot && i != clippingAttachmentSource) { + clippingEndSlot = null; + clippingAttachmentSource = -1; + } } if (current.rawVertexCount > 0) {