From ae73a452bb06cd4b1fd71e4431483484c4739adc Mon Sep 17 00:00:00 2001 From: Harald Csaszar Date: Tue, 6 Aug 2019 11:35:01 +0200 Subject: [PATCH] [unity] Fixed potential (non-critical) error messages on first import due to import order. Related to commit regarding GUI icon loading: bc85618. --- .../spine-unity/Editor/Utility/SpineEditorUtilities.cs | 9 +++++++-- 1 file changed, 7 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 0dbb42bfa..beeb6452f 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 @@ -97,8 +97,13 @@ namespace Spine.Unity.Editor { editorPath = Path.GetDirectoryName(assetPath).Replace("\\", "/"); assets = AssetDatabase.FindAssets("t:texture icon-subMeshRenderer"); - assetPath = AssetDatabase.GUIDToAssetPath(assets[0]); - editorGUIPath = Path.GetDirectoryName(assetPath).Replace("\\", "/"); + if (assets.Length > 0) { + assetPath = AssetDatabase.GUIDToAssetPath(assets[0]); + editorGUIPath = Path.GetDirectoryName(assetPath).Replace("\\", "/"); + } + else { + editorGUIPath = editorPath.Replace("/Utility", "/GUI"); + } Icons.Initialize(); // Drag and Drop