From e39f74837a615e32e97ffac3b89eb692e3783ad6 Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Mon, 13 Jun 2022 16:26:12 +0200 Subject: [PATCH] [unity] Fixed UPM package Index out of bounds exception in editor code. Closes #2095. --- .../spine-unity/Editor/Utility/SpineEditorUtilities.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/spine-unity/Assets/Spine/Editor/spine-unity/Editor/Utility/SpineEditorUtilities.cs b/spine-unity/Assets/Spine/Editor/spine-unity/Editor/Utility/SpineEditorUtilities.cs index 83195bfd6..f5c04df3d 100644 --- a/spine-unity/Assets/Spine/Editor/spine-unity/Editor/Utility/SpineEditorUtilities.cs +++ b/spine-unity/Assets/Spine/Editor/spine-unity/Editor/Utility/SpineEditorUtilities.cs @@ -172,11 +172,12 @@ namespace Spine.Unity.Editor { if (EditorApplication.isPlayingOrWillChangePlaymode) return; - string[] assets = AssetDatabase.FindAssets("t:script SpineEditorUtilities"); + string[] folders = { "Assets", "Packages" }; + string[] assets = AssetDatabase.FindAssets("t:script SpineEditorUtilities", folders); string assetPath = AssetDatabase.GUIDToAssetPath(assets[0]); editorPath = Path.GetDirectoryName(assetPath).Replace('\\', '/'); - assets = AssetDatabase.FindAssets("t:texture icon-subMeshRenderer"); + assets = AssetDatabase.FindAssets("t:texture icon-subMeshRenderer", folders); if (assets.Length > 0) { assetPath = AssetDatabase.GUIDToAssetPath(assets[0]); editorGUIPath = Path.GetDirectoryName(assetPath).Replace('\\', '/');