Explorar el Código

打包加上CodeMode检测

tanghai hace 2 años
padre
commit
e9f8d695eb

+ 12 - 1
Unity/Assets/Scripts/Editor/BuildEditor/BuildEditor.cs

@@ -91,9 +91,16 @@ namespace ET
 			{
 				if (this.platformType == PlatformType.None)
 				{
-					ShowNotification(new GUIContent("please select platform!"));
+					Log.Error("please select platform!");
 					return;
 				}
+				
+				if (this.globalConfig.CodeMode != CodeMode.Client)
+				{
+					Log.Error("build package CodeMode must be CodeMode.Client, please select Client, RegenerateCSProject, then rebuild Hotfix and Model !!!");
+					return;
+				}
+				
 				if (platformType != activePlatform)
 				{
 					switch (EditorUtility.DisplayDialogComplex("Warning!", $"current platform is {activePlatform}, if change to {platformType}, may be take a long time", "change", "cancel", "no change"))
@@ -109,6 +116,7 @@ namespace ET
 					}
 				}
 				BuildHelper.Build(this.platformType, this.buildAssetBundleOptions, this.buildOptions, this.clearFolder);
+				return;
 			}
 			
 			GUILayout.Label("");
@@ -140,16 +148,19 @@ namespace ET
 			if (GUILayout.Button("ReGenerateProjectFiles"))
 			{
 				BuildHelper.ReGenerateProjectFiles();
+				return;
 			}
 			
 			if (GUILayout.Button("ExcelExporter"))
 			{
 				ToolsEditor.ExcelExporter();
+				return;
 			}
 			
 			if (GUILayout.Button("Proto2CS"))
 			{
 				ToolsEditor.Proto2CS();
+				return;
 			}
 
 			GUILayout.Space(5);

+ 1 - 7
Unity/Assets/Scripts/Editor/BuildEditor/BuildHelper.cs

@@ -79,19 +79,13 @@ namespace ET
                 }
                 ss.Remove(symbols);
             }
-            BuildHelper.ShowNotification($"EnableDefineSymbols {symbols} {enable}");
+            Log.Debug($"EnableDefineSymbols {symbols} {enable}");
             defines = string.Join(";", ss);
             PlayerSettings.SetScriptingDefineSymbolsForGroup(EditorUserBuildSettings.selectedBuildTargetGroup, defines);
             AssetDatabase.SaveAssets();
             AssetDatabase.Refresh();
         }
         
-        public static void ShowNotification(string tips)
-        {
-            EditorWindow game = EditorWindow.GetWindow(typeof(EditorWindow).Assembly.GetType("UnityEditor.GameView"));
-            game?.ShowNotification(new GUIContent($"{tips}"));
-        }
-
         public static void Build(PlatformType type, BuildAssetBundleOptions buildAssetBundleOptions, BuildOptions buildOptions, bool clearFolder)
         {
             BuildTarget buildTarget = BuildTarget.StandaloneWindows;