From 0138a9576fc4cdbbf2307245503eba3aecb6295a Mon Sep 17 00:00:00 2001 From: gaoxin Date: Thu, 17 Jun 2021 11:16:11 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=89=93=E5=8C=85=E5=B7=A5=E5=85=B7?= =?UTF-8?q?=E3=80=91=E6=B7=BB=E5=8A=A0=E6=A0=B9=E6=8D=AE=E5=88=86=E6=94=AF?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E8=A6=81=E6=89=93=E7=9A=84=E5=8C=85=EF=BC=8C?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=81=B5=E5=8A=A8=E5=95=86=E5=8A=A1=E6=9C=8D?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Editor/AutoPack.cs | 65 +++++++++++++++++++++++---------------- 1 file changed, 39 insertions(+), 26 deletions(-) diff --git a/Assets/Editor/AutoPack.cs b/Assets/Editor/AutoPack.cs index a6bc9ba6d6..c94bced8f8 100644 --- a/Assets/Editor/AutoPack.cs +++ b/Assets/Editor/AutoPack.cs @@ -9,11 +9,18 @@ public class AutoPack : EditorWindow { static string[][] PackConfig = new string[][] { - new string[]{ "C轮v2", "Logo_gm_nosdk", "TCX_TEST_C_V2"}, - new string[]{ "灵动专服-测试", "Logo_gn_zf_test", "MHT_GN_ZF_TEST" }, - new string[]{ "灵动专服-正式", "Logo_gn_zf_release", "MHT_GN_ZF_RELEASE" }, - new string[]{ "喜扑", "Logo_cn_xipu", "MHT_CN_XIPU"}, - new string[]{ "草花", "Logo_cn_caohua", "MHT_CN_MIDDLE_WARE" }, + // 专服 + new string[]{ "C轮v2", "Logo_gm_nosdk", "TCX_TEST_C_V2", "china/zf_test"}, + new string[]{ "灵动专服-测试", "Logo_gn_zf_test", "MHT_GN_ZF_TEST" , "china/zf_test"}, + new string[]{ "灵动专服-正式", "Logo_gn_zf_release", "MHT_GN_ZF_RELEASE" , "china/zf_test"}, + new string[]{ "喜扑", "Logo_cn_xipu", "MHT_CN_XIPU", "china/zf_test"}, + new string[]{ "草花", "Logo_cn_caohua", "MHT_CN_MIDDLE_WARE" , "china/zf_test"}, + + // 灵动商务 + new string[]{ "灵动商务", "Logo_mht_sw", "MHT_GN_SW" , "china/dev"}, + + + //先遣 }; @@ -49,6 +56,7 @@ public class AutoPack : EditorWindow static int ExportType; static bool[] Chooser; static bool isObb = false; + static string benchName; // 当前所在分支 private void OnEnable() @@ -84,6 +92,9 @@ public class AutoPack : EditorWindow [MenuItem("自动化打包/一键导出")] private static void EzBuildPack() { + + benchName = GitUtil.GetCurBenchName(); + UnityEngine.Debug.Log("当前分支:" + benchName); //创建窗口 Rect wr = new Rect(0, 0, 500, 700); var buildWin = GetWindowWithRect(wr, true); @@ -119,29 +130,31 @@ public class AutoPack : EditorWindow EditorGUILayout.LabelField("请选择要打的包:"); for(int i = 0; i < PackConfig.Length; i++) { - EditorGUILayout.BeginVertical(); - Chooser[i] = EditorGUILayout.ToggleLeft(PackConfig[i][0], Chooser[i]); - EditorGUILayout.BeginHorizontal(); - if (GUILayout.Button("编辑Config", GUILayout.Height(20f))) + if (PackConfig[i][3].Equals(benchName)) { - string tpath = _MomPackPath + PackConfig[i][2] + "/Config/" + ConfigFileName; - GameEditor.Util.ProcessUtil.OpenText(tpath); + EditorGUILayout.BeginVertical(); + Chooser[i] = EditorGUILayout.ToggleLeft(PackConfig[i][0], Chooser[i]); + EditorGUILayout.BeginHorizontal(); + if (GUILayout.Button("编辑Config", GUILayout.Height(20f))) + { + string tpath = _MomPackPath + PackConfig[i][2] + "/Config/" + ConfigFileName; + GameEditor.Util.ProcessUtil.OpenText(tpath); + } + if (GUILayout.Button("编辑Version", GUILayout.Height(20f))) + { + string tpath = _MomPackPath + PackConfig[i][2] + "/Config/" + VersionFileName; + GameEditor.Util.ProcessUtil.OpenText(tpath); + } + if (GUILayout.Button("编辑Gradle", GUILayout.Height(20f))) + { + string tpath = _MomPackPath + PackConfig[i][2] + "/build.gradle"; + GameEditor.Util.ProcessUtil.OpenText(tpath); + } + EditorGUILayout.EndHorizontal(); + EditorGUILayout.EndVertical(); + EditorGUILayout.Space(); + EditorGUILayout.Space(); } - if (GUILayout.Button("编辑Version", GUILayout.Height(20f))) - { - string tpath = _MomPackPath + PackConfig[i][2] + "/Config/" + VersionFileName; - GameEditor.Util.ProcessUtil.OpenText(tpath); - } - if (GUILayout.Button("编辑Gradle", GUILayout.Height(20f))) - { - string tpath = _MomPackPath + PackConfig[i][2] + "/build.gradle"; - GameEditor.Util.ProcessUtil.OpenText(tpath); - } - EditorGUILayout.EndHorizontal(); - EditorGUILayout.EndVertical(); - EditorGUILayout.Space(); - EditorGUILayout.Space(); - } ExportType = EditorGUILayout.Popup("请选择出包方式", ExportType, ExportTypeList);