Jelajahi Sumber

Unity release模式 ide编译开启优化选项

tanghai 2 tahun lalu
induk
melakukan
c473d42f95

+ 2 - 0
.gitignore

@@ -89,3 +89,5 @@ Publish/
 /Unity/Assets/Bundles/AotDlls.meta
 /Unity/HybridCLRData
 /Unity/Assembly-CSharp-firstpass.csproj
+
+/Unity/*.csproj

+ 5 - 0
Unity/Assets/Scripts/Editor/AssetPostProcessor/OnGenerateCSProjectProcessor.cs

@@ -40,6 +40,11 @@ namespace ET
             }
             else
             {
+                if (Define.IsDebug)
+                {
+                    content = content.Replace("<Optimize>false</Optimize>", "<Optimize>true</Optimize>");
+                }
+                
                 if (path.EndsWith("Unity.Hotfix.csproj"))
                 {
                     content = content.Replace("<Compile Include=\"Assets\\Scripts\\Empty\\Hotfix\\Empty.cs\" />", string.Empty);

+ 5 - 0
Unity/Assets/Scripts/Loader/Define.cs

@@ -4,6 +4,11 @@
 	{
 		public const string CodeDir = "Assets/Bundles/Code/";
 		public const string BuildOutputDir = "Temp/Bin/Debug";
+#if DEBUG
+		public static bool IsDebug = true;
+#else
+		public static bool IsDebug = false;
+#endif
 		
 #if UNITY_EDITOR && !ASYNC
 		public static bool IsAsync = false;

File diff ditekan karena terlalu besar
+ 0 - 28
Unity/Unity.AllCodes.csproj


File diff ditekan karena terlalu besar
+ 0 - 28
Unity/Unity.AllHotfix.csproj


File diff ditekan karena terlalu besar
+ 0 - 28
Unity/Unity.AllModel.csproj


Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini