[unity] Improved error message when SkeletonDataAsset has 0 atlas and HiddenPass shader not included. Closes #2544. Also fixed quiet param unused at GetSkeletonData call.

This commit is contained in:
Harald Csaszar 2024-06-06 18:12:19 +02:00
parent 568e5ef049
commit e622c6b5dd
3 changed files with 9 additions and 3 deletions

View File

@ -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" }
}
};
}

View File

@ -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;

View File

@ -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",