From 97e3dd4134ff045d1bf7a2211f26be6486df289a Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Thu, 14 Sep 2023 15:22:41 +0200 Subject: [PATCH] [unity] Fixed exception when separation leads to empty mesh with no material at SkeletonGraphic. Closes #2364. --- .../Spine/Runtime/spine-unity/Components/SkeletonGraphic.cs | 5 +++++ spine-unity/Assets/Spine/package.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonGraphic.cs b/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonGraphic.cs index 759beb9b9..d8e0cf2dc 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonGraphic.cs +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonGraphic.cs @@ -842,6 +842,11 @@ protected void UpdateMaterialsMultipleCanvasRenderers (SkeletonRendererInstructi SubmeshInstruction submeshInstructionItem = currentInstructions.submeshInstructions.Items[i]; Material submeshMaterial = submeshInstructionItem.material; if (useOriginalTextureAndMaterial) { + if (submeshMaterial == null) { + usedMaterialItems[i] = null; + usedTextureItems[i] = null; + continue; + } usedTextureItems[i] = submeshMaterial.mainTexture; if (!hasBlendModeMaterials) { usedMaterialItems[i] = this.materialForRendering; diff --git a/spine-unity/Assets/Spine/package.json b/spine-unity/Assets/Spine/package.json index 755ff2f0d..a2abb5faf 100644 --- a/spine-unity/Assets/Spine/package.json +++ b/spine-unity/Assets/Spine/package.json @@ -2,7 +2,7 @@ "name": "com.esotericsoftware.spine.spine-unity", "displayName": "spine-unity Runtime", "description": "This plugin provides the spine-unity runtime core.", - "version": "4.1.23", + "version": "4.1.24", "unity": "2018.3", "author": { "name": "Esoteric Software",