瀏覽代碼

[unity] Fixed potential (non-critical) error messages on first import due to import order. Related to commit regarding GUI icon loading: bc85618.

Harald Csaszar 6 年之前
父節點
當前提交
39a45060a3
共有 1 個文件被更改,包括 7 次插入2 次删除
  1. 7 2
      spine-unity/Assets/Spine/Editor/spine-unity/Editor/Utility/SpineEditorUtilities.cs

+ 7 - 2
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