Browse Source

增加在Editor启动时,如为AB模式,则显示Notification提示一下

大爷 2 years ago
parent
commit
f37833337f
1 changed files with 11 additions and 4 deletions
  1. 11 4
      Unity/Assets/Scripts/Loader/MonoBehaviour/Init.cs

+ 11 - 4
Unity/Assets/Scripts/Loader/MonoBehaviour/Init.cs

@@ -1,9 +1,6 @@
 using System;
-using System.Threading;
 using CommandLine;
-using Sirenix.OdinInspector;
 using UnityEngine;
-using YooAsset;
 
 namespace ET
 {
@@ -21,6 +18,16 @@ namespace ET
             {
                 GameObject.Destroy(debugObj);
             }
+            var globalConfig = Resources.Load<GlobalConfig>("GlobalConfig");
+            if (globalConfig.PlayMode != YooAsset.YooAssets.EPlayMode.EditorSimulateMode)
+            {
+                var window = UnityEditor.EditorWindow.GetWindow(typeof(UnityEditor.EditorWindow), true, "Game");
+                if(window != null)
+                {
+                    window.ShowNotification(new GUIContent($"PlayMode is {globalConfig.PlayMode}"), 5);
+                }
+                return;
+            }
 #endif
             DontDestroyOnLoad(gameObject);
 
@@ -69,4 +76,4 @@ namespace ET
 			Game.Close();
 		}
 	}
-}
+}