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);