void Present_Main() { EditorGUILayout.BeginVertical(VerticalStyle); if (BuildLocalConfig.Ins.Fold_Present_Main = EditorGUILayout.Foldout(BuildLocalConfig.Ins.Fold_Present_Main, "构建", true)) { BuildConfig.Platform = (Platform)EditorGUILayout.Popup("目标", (int)BuildConfig.Platform, Enum.GetNames(typeof(Platform))); BuildConfig.Distribution = (Distribution)EditorGUILayout.EnumPopup("发布平台", BuildConfig.Distribution); EditorGUILayout.LabelField(string.Format("版本号预览:{0}", BuildConfig)); EditorGUILayout.LabelField(string.Format("完整版本号预览:{0}", BuildConfig.FullVersionName)); BuildConfig.Name = EditorGUILayout.TextField("名称", BuildConfig.Name); BuildConfig.SubTitle = EditorGUILayout.TextField("副标题", BuildConfig.SubTitle); BuildConfig.Major = EditorGUILayout.IntField("主版本", BuildConfig.Major); BuildConfig.Minor = EditorGUILayout.IntField("副版本", BuildConfig.Minor); BuildConfig.Data = EditorGUILayout.IntField("数据库版本", BuildConfig.Data); BuildConfig.Prefs = EditorGUILayout.IntField("Prefs", BuildConfig.Prefs); EditorGUILayout.BeginHorizontal(); BuildConfig.Tag = (VersionTag)EditorGUILayout.EnumPopup("后缀", BuildConfig.Tag); BuildConfig.Suffix = EditorGUILayout.IntField(BuildConfig.Suffix); EditorGUILayout.EndHorizontal(); BuildConfig.BuildType = (BuildType)EditorGUILayout.EnumPopup("打包版本", BuildConfig.BuildType); BuildConfig.IgnoreChecker = EditorGUILayout.Toggle("忽略检查", BuildConfig.IgnoreChecker); bool preDevelopmentBuild = BuildConfig.IsUnityDevelopmentBuild; BuildConfig.IsUnityDevelopmentBuild = EditorGUILayout.Toggle("UnityDevBuild", BuildConfig.IsUnityDevelopmentBuild); if (preDevelopmentBuild != BuildConfig.IsUnityDevelopmentBuild) { EditorUserBuildSettings.development = BuildConfig.IsUnityDevelopmentBuild; } if (PlayerSettings.bundleVersion != BuildConfig.ToString()) { PlayerSettings.bundleVersion = BuildConfig.ToString(); } EditorGUILayout.BeginHorizontal(); if (GUILayout.Button("构建Manifest")) { Builder.BuildManifest(Native); } if (GUILayout.Button("构建AB")) { Builder.BuildBundle(Native); } if (GUILayout.Button("构建EXE")) { if (CheckEorr()) { return; } if (!CheckDevBuildWarring()) { return; } if (!CheckAuthority()) { return; } Builder.BuildEXE(); } if (GUILayout.Button("构建AB&EXE")) { if (CheckEorr()) { return; } if (!CheckDevBuildWarring()) { return; } if (!CheckAuthority()) { return; } Builder.BuildBundleAndEXE(Native); } EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); if (GUILayout.Button("运行游戏")) { BaseFileUtils.OpenFile(BuildConfig.ExePath); CLog.Info("Run:{0}", BuildConfig.ExePath); } EditorGUILayout.EndHorizontal(); } EditorGUILayout.EndVertical(); }
protected static void SafeOpenJsonFile <T>(string path, T data) where T : class { BaseFileUtils.UpdateFile(path, data); BaseFileUtils.OpenFile(path); }