From 0a3b5dbb31e7792f9fd3f106534d968712645323 Mon Sep 17 00:00:00 2001 From: Marllon Vilano Date: Mon, 19 Feb 2024 13:42:33 -0300 Subject: [PATCH] Fix for IndexOutOfRangeException: Index was outside the bounds of the array --- .../Editor/GenericOnDemandTextureLoaderInspector.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/spine-unity/Modules/com.esotericsoftware.spine.on-demand-loading/Editor/GenericOnDemandTextureLoaderInspector.cs b/spine-unity/Modules/com.esotericsoftware.spine.on-demand-loading/Editor/GenericOnDemandTextureLoaderInspector.cs index 50ce4aceb..f9168ce72 100644 --- a/spine-unity/Modules/com.esotericsoftware.spine.on-demand-loading/Editor/GenericOnDemandTextureLoaderInspector.cs +++ b/spine-unity/Modules/com.esotericsoftware.spine.on-demand-loading/Editor/GenericOnDemandTextureLoaderInspector.cs @@ -374,7 +374,12 @@ namespace Spine.Unity.Editor { public void DeletePlaceholderTextures (GenericOnDemandTextureLoader loader) { foreach (var materialMap in loader.placeholderMap) { - Texture texture = materialMap.textures[0].placeholderTexture; + var textures = materialMap.textures; + if (textures == null || textures.Length == 0) { + continue; + } + + Texture texture = textures[0].placeholderTexture; if (texture) AssetDatabase.DeleteAsset(AssetDatabase.GetAssetPath(texture)); }