Răsfoiți Sursa

增加Hotfix自动构建功能,只在!Async&&!ILRuntime模式下有用 (#88)

ChaosDev 7 ani în urmă
părinte
comite
71871f1d4c

+ 32 - 0
Unity/Assets/Editor/BuildEditor/BuildHotifxEditor.cs

@@ -0,0 +1,32 @@
+using System.Diagnostics;
+using UnityEditor;
+using UnityEngine;
+
+namespace ETEditor
+{
+#if !ASYNC && !ILRUNTIME
+    public class BuildHotifxEditor
+    {
+        [RuntimeInitializeOnLoadMethod ( RuntimeInitializeLoadType.BeforeSceneLoad )]
+        static void BeforeSceneLoad ()
+        {
+            string batPath = Application.dataPath + "/../Tools/DevAutoCompile.bat";
+
+            ProcessStartInfo info = new ProcessStartInfo
+            {
+                    FileName = batPath, WindowStyle = ProcessWindowStyle.Hidden, ErrorDialog = true,
+                    UseShellExecute = Application.platform == RuntimePlatform.WindowsEditor, Arguments = $"\"{MSBuildPath}\" \"{HotfixPath}\""
+            };
+
+            Process p = Process.Start ( info );
+            p.WaitForExit ();
+
+            AssetDatabase.Refresh ();
+        }
+
+        private const string MSBuildPath = "D:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\Tools\\VsDevCmd.bat";
+
+        private const string HotfixPath = "D:\\Projects\\Unity Project\\TDGo\\Client\\Trunk\\Client\\Hotfix\\Unity.Hotfix.csproj";
+    }
+#endif
+}

+ 3 - 0
Unity/Assets/Editor/BuildEditor/BuildHotifxEditor.cs.meta

@@ -0,0 +1,3 @@
+fileFormatVersion: 2
+guid: 2e1e4f1d4a4a4947aaf6ebce9e8f56f1
+timeCreated: 1536992291

+ 3 - 0
Unity/Tools/DevAutoCompile.bat

@@ -0,0 +1,3 @@
+@echo off  
+call %1
+MSBuild %2 /t:Build /p:Platform=AnyCPU /p:Configuration=Debug