From e622c6b5dd3e1dd47cdea8da8f107a6edc891690 Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Thu, 6 Jun 2024 18:12:19 +0200 Subject: [PATCH] [unity] Improved error message when SkeletonDataAsset has 0 atlas and HiddenPass shader not included. Closes #2544. Also fixed `quiet` param unused at GetSkeletonData call. --- .../spine-unity/Asset Types/RegionlessAttachmentLoader.cs | 8 +++++++- .../Runtime/spine-unity/Components/SkeletonRenderer.cs | 2 +- spine-unity/Assets/Spine/package.json | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Asset Types/RegionlessAttachmentLoader.cs b/spine-unity/Assets/Spine/Runtime/spine-unity/Asset Types/RegionlessAttachmentLoader.cs index 05e1ec044..7d7d7cb70 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Asset Types/RegionlessAttachmentLoader.cs +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Asset Types/RegionlessAttachmentLoader.cs @@ -38,11 +38,17 @@ namespace Spine.Unity { static AtlasRegion EmptyRegion { get { if (emptyRegion == null) { + Shader hiddenShader = Shader.Find("Spine/Special/HiddenPass"); + if (hiddenShader == null) { + Debug.LogError("Shader \"Spine/Special/HiddenPass\" not found while loading SkeletonDataAsset" + + " with 0 Atlas Assets. Please add this shader to Project Settings - Graphics - Always" + + " Included Shaders, or make sure your SkeletonDataAssets all have an AtlasAsset assigned."); + } emptyRegion = new AtlasRegion { name = "Empty AtlasRegion", page = new AtlasPage { name = "Empty AtlasPage", - rendererObject = new Material(Shader.Find("Spine/Special/HiddenPass")) { name = "NoRender Material" } + rendererObject = new Material(hiddenShader) { name = "NoRender Material" } } }; } diff --git a/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonRenderer.cs b/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonRenderer.cs index 68d1d6f89..c41645618 100644 --- a/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonRenderer.cs +++ b/spine-unity/Assets/Spine/Runtime/spine-unity/Components/SkeletonRenderer.cs @@ -473,7 +473,7 @@ namespace Spine.Unity { if (skeletonDataAsset == null) return; - SkeletonData skeletonData = skeletonDataAsset.GetSkeletonData(false); + SkeletonData skeletonData = skeletonDataAsset.GetSkeletonData(quiet); if (skeletonData == null) return; valid = true; diff --git a/spine-unity/Assets/Spine/package.json b/spine-unity/Assets/Spine/package.json index b641aaa91..718a4cd55 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.2.68", + "version": "4.2.69", "unity": "2018.3", "author": { "name": "Esoteric Software",