瀏覽代碼

[unity] Changed implementation of previous bugfix commit ab91a35 of Editor error messages upon startup. Uses less code and executes a bit earlier. See #1779.

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

+ 1 - 7
spine-unity/Assets/Spine/Editor/spine-unity/Editor/Utility/SpineEditorUtilities.cs

@@ -69,7 +69,6 @@ namespace Spine.Unity.Editor {
 		public static string editorPath = "";
 		public static string editorGUIPath = "";
 		public static bool initialized;
-		private static int numFramesToDelayInit = 1;
 		private static List<string> texturesWithoutMetaFile = new List<string>();
 
 		// Auto-import entry point for textures
@@ -97,16 +96,11 @@ namespace Spine.Unity.Editor {
 		}
 
 #region Initialization
-
 		static SpineEditorUtilities () {
-			EditorApplication.update += Initialize; // delayed so that AssetDatabase is ready.
+			EditorApplication.delayCall += Initialize; // delayed so that AssetDatabase is ready.
 		}
 
 		static void Initialize () {
-			if (numFramesToDelayInit-- > 0)
-				return;
-			EditorApplication.update -= Initialize;
-
 			// Note: Preferences need to be loaded when changing play mode
 			// to initialize handle scale correctly.
 			#if !NEW_PREFERENCES_SETTINGS_PROVIDER