/** App */ void OnGUI_App() { Version version = appVersion; GUILayout.BeginHorizontal(); HGUILayout.Version("App版本", version, VersionType.App); GUILayout.BeginVertical(); if (GUILayout.Button("最后一次", GUILayout.Width(100), GUILayout.Height(30))) { VersionList.Read(true); version.Copy(VersionList.lastAppVersion); version.revised = 0; version.verType = VersionType.App; } if (GUILayout.Button("自动", GUILayout.Width(100), GUILayout.Height(30))) { VersionList.Read(true); version.Copy(VersionList.lastAppVersion); version.minor++; version.revised = 0; version.verType = VersionType.App; } GUILayout.EndVertical(); GUILayout.EndHorizontal(); GUILayout.Space(20); HGUILayout.BeginCenterHorizontal(); if (GUILayout.Button("生成版本信息", GUILayout.MinHeight(50), GUILayout.MaxWidth(200))) { version.SetNowDatetime(); bool isRefresh = false; if (currentDvancedSettingData.GetValue(DvancedSettingType.ClearAllPlatformDirctory)) { PathUtil.ClearAllPlatformDirctory(); isRefresh = true; } if (currentDvancedSettingData.GetValue(DvancedSettingType.ClearOtherPlatformDirctory)) { PathUtil.ClearOtherPlatformDirctory(runtimePlatform); isRefresh = true; } if (currentDvancedSettingData.GetValue(DvancedSettingType.ClearTestData)) { PathUtil.ClearTestData(); isRefresh = true; } if (isRefresh) { AssetDatabase.Refresh(); } if (currentDvancedSettingData.GetValue(DvancedSettingType.AB_luacode)) { AB.Lua(); } if (currentDvancedSettingData.GetValue(DvancedSettingType.AB_config)) { AB.Config(); } if (currentDvancedSettingData.GetValue(DvancedSettingType.Clear_AssetBundleName)) { AssetBundleEditor.ClearAssetBundleNames(); AssetDatabase.RemoveUnusedAssetBundleNames(); } if (currentDvancedSettingData.GetValue(DvancedSettingType.Set_AssetBundleName)) { AssetBundleEditor.SetNames(); } if (currentDvancedSettingData.GetValue(DvancedSettingType.AB_AssetBundle)) { AssetBundleEditor.BuildAssetBundles(); } if (currentDvancedSettingData.GetValue(DvancedSettingType.GameConstConfig)) { GameConstConfig config = GameConstConfig.Load(); config.DevelopMode = false; config.Version = version.ToConfig(); config.Save(); } if (currentDvancedSettingData.GetValue(DvancedSettingType.GeneratorStreamingAssetsFilesCSV)) { FilesCsvForStreamingAssets.Generator(); } if (currentDvancedSettingData.GetValue(DvancedSettingType.GeneratorResourcesFilesCSV)) { FilesCsvForResources.Generator(); } if (currentDvancedSettingData.GetValue(DvancedSettingType.PlayerSettings)) { SetPlayerSettings(runtimePlatform); } if (currentDvancedSettingData.GetValue(DvancedSettingType.PlayerSettingsVersion)) { SetPlayerSettingsVersion(appVersion); } if (currentDvancedSettingData.GetValue(DvancedSettingType.GenerateVersionInfo)) { FilesCsvForStreamingAssets.CopyStreamFilesCsvToVersion(version); } if (currentDvancedSettingData.GetValue(DvancedSettingType.GeneratorUpdateAssetList)) { FilesCsvForStreamingAssets.GeneratorUpdateList(null); } } HGUILayout.EndCenterHorizontal(); }
/** 补丁 */ void OnGUI_Patch() { Version version = patchVersion; if (version.revised <= 0) { version.revised = 1; } GUILayout.BeginHorizontal(HGUILayout.boxMPStyle, GUILayout.Height(50)); EditorGUILayout.LabelField("参照App版本", HGUILayout.labelCenterStyle, GUILayout.Width(150), GUILayout.Height(25)); int preCompareIndex = compareIndex; compareIndex = EditorGUILayout.Popup(compareIndex, VersionList.appVersionStrArr); if (preCompareIndex != compareIndex && compareIndex != -1) { Version v = VersionList.appVersionList[compareIndex]; compareVersion.Copy(v); version.Copy(VersionList.GetLastAppRevised(compareVersion)); version.verType = VersionType.Patch; version.revised++; } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); HGUILayout.Version("补丁版本", version, VersionType.Patch); GUILayout.BeginVertical(); if (GUILayout.Button("最后一次", GUILayout.Width(100), GUILayout.Height(30))) { VersionList.Read(true); compareVersion.Copy(VersionList.lastAppVersion); version.Copy(VersionList.GetLastAppRevised(compareVersion)); version.verType = VersionType.Patch; compareIndex = VersionList.appVersionStrList.IndexOf(compareVersion.ToString()); } if (GUILayout.Button("自动", GUILayout.Width(100), GUILayout.Height(30))) { VersionList.Read(true); compareVersion.Copy(VersionList.lastAppVersion); version.Copy(VersionList.GetLastAppRevised(compareVersion)); version.verType = VersionType.Patch; version.revised++; compareIndex = VersionList.appVersionStrList.IndexOf(compareVersion.ToString()); } GUILayout.EndVertical(); GUILayout.EndHorizontal(); GUILayout.Space(20); HGUILayout.BeginCenterHorizontal(); if (GUILayout.Button("生成版本信息", GUILayout.MinHeight(50), GUILayout.MaxWidth(200))) { version.SetNowDatetime(); bool isRefresh = false; if (currentDvancedSettingData.GetValue(DvancedSettingType.ClearAllPlatformDirctory)) { PathUtil.ClearAllPlatformDirctory(); isRefresh = true; } if (currentDvancedSettingData.GetValue(DvancedSettingType.ClearOtherPlatformDirctory)) { PathUtil.ClearOtherPlatformDirctory(runtimePlatform); isRefresh = true; } if (currentDvancedSettingData.GetValue(DvancedSettingType.ClearTestData)) { PathUtil.ClearTestData(); isRefresh = true; } if (isRefresh) { AssetDatabase.Refresh(); } if (currentDvancedSettingData.GetValue(DvancedSettingType.AB_luacode)) { AB.Lua(); } if (currentDvancedSettingData.GetValue(DvancedSettingType.AB_config)) { AB.Config(); } if (currentDvancedSettingData.GetValue(DvancedSettingType.AB_luacode)) { AB.Lua(); } if (currentDvancedSettingData.GetValue(DvancedSettingType.AB_config)) { AB.Config(); } if (currentDvancedSettingData.GetValue(DvancedSettingType.Clear_AssetBundleName)) { AssetBundleEditor.ClearAssetBundleNames(); AssetDatabase.RemoveUnusedAssetBundleNames(); } if (currentDvancedSettingData.GetValue(DvancedSettingType.Set_AssetBundleName)) { AssetBundleEditor.SetNames(); } if (currentDvancedSettingData.GetValue(DvancedSettingType.AB_AssetBundle)) { AssetBundleEditor.BuildAssetBundles(); } if (currentDvancedSettingData.GetValue(DvancedSettingType.GameConstConfig)) { GameConstConfig config = GameConstConfig.Load(); config.DevelopMode = false; config.Version = version.ToConfig(); config.Save(); } if (currentDvancedSettingData.GetValue(DvancedSettingType.GeneratorStreamingAssetsFilesCSV)) { FilesCsvForStreamingAssets.Generator(); } if (currentDvancedSettingData.GetValue(DvancedSettingType.GeneratorResourcesFilesCSV)) { FilesCsvForResources.Generator(); } if (currentDvancedSettingData.GetValue(DvancedSettingType.PlayerSettings)) { SetPlayerSettings(runtimePlatform); } if (currentDvancedSettingData.GetValue(DvancedSettingType.PlayerSettingsVersion)) { SetPlayerSettingsVersion(appVersion); } if (currentDvancedSettingData.GetValue(DvancedSettingType.GenerateVersionInfo)) { FilesCsvForStreamingAssets.CopyStreamFilesCsvToVersion(version); } if (currentDvancedSettingData.GetValue(DvancedSettingType.GeneratorUpdateAssetList)) { FilesCsvForStreamingAssets.GeneratorUpdateList(compareVersion); } } HGUILayout.EndCenterHorizontal(); }
void OnGUI() { VersionList.Read(); TabType tabType = HGUILayout.TabGroup <TabType>(tabGroupData); scrollPos = EditorGUILayout.BeginScrollView(scrollPos); GUILayout.Space(20); currentDvancedSettingData = dvancedSettingDataDict[tabType]; switch (tabType) { case TabType.Develop: OnGUI_Develop(); break; case TabType.App: OnGUI_App(); break; case TabType.Patch: OnGUI_Patch(); break; } currentDvancedSettingData.foldout = EditorGUILayout.Foldout(currentDvancedSettingData.foldout, "高级设置"); if (currentDvancedSettingData.foldout) { GUILayout.BeginVertical(HGUILayout.boxMPStyle); for (int i = 0; i < currentDvancedSettingData.list.Count; i++) { DvancedSettingItem item = currentDvancedSettingData.list[i]; GUILayout.BeginHorizontal(); item.value = EditorGUILayout.ToggleLeft(item.name, item.value, GUILayout.Width(250)); if (GUILayout.Button(item.name, GUILayout.Width(250))) { switch (item.type) { case DvancedSettingType.ClearAllPlatformDirctory: PathUtil.ClearAllPlatformDirctory(); AssetDatabase.Refresh(); break; case DvancedSettingType.ClearOtherPlatformDirctory: PathUtil.ClearOtherPlatformDirctory(runtimePlatform); AssetDatabase.Refresh(); break; case DvancedSettingType.ClearTestData: PathUtil.ClearTestData(); AssetDatabase.Refresh(); break; case DvancedSettingType.AB_luacode: AB.Lua(); break; case DvancedSettingType.AB_config: AB.Config(); break; case DvancedSettingType.Clear_AssetBundleName: AssetBundleEditor.ClearAssetBundleNames(); AssetDatabase.RemoveUnusedAssetBundleNames(); break; case DvancedSettingType.Set_AssetBundleName: AssetBundleEditor.SetNames(); break; case DvancedSettingType.GameConstConfig: GameConstConfig config = GameConstConfig.Load(); switch (tabType) { case TabType.Develop: config.DevelopMode = true; config.TestVersionMode = false; break; case TabType.App: config.DevelopMode = false; config.Version = appVersion.ToConfig(); break; case TabType.Patch: config.DevelopMode = false; config.Version = patchVersion.ToConfig(); break; } config.Save(); break; case DvancedSettingType.GeneratorStreamingAssetsFilesCSV: switch (tabType) { case TabType.App: case TabType.Patch: FilesCsvForStreamingAssets.Generator(); break; case TabType.Develop: FilesCsvForStreamingAssets.Generator(true); break; } break; case DvancedSettingType.GeneratorResourcesFilesCSV: FilesCsvForResources.Generator(); break; case DvancedSettingType.PlayerSettings: SetPlayerSettings(runtimePlatform); break; case DvancedSettingType.PlayerSettingsVersion: switch (tabType) { case TabType.App: SetPlayerSettingsVersion(appVersion); break; case TabType.Patch: SetPlayerSettingsVersion(patchVersion); break; } break; case DvancedSettingType.GenerateVersionInfo: switch (tabType) { case TabType.App: appVersion.SetNowDatetime(); FilesCsvForStreamingAssets.CopyStreamFilesCsvToVersion(appVersion); break; case TabType.Patch: patchVersion.SetNowDatetime(); FilesCsvForStreamingAssets.CopyStreamFilesCsvToVersion(patchVersion); break; } break; case DvancedSettingType.GeneratorUpdateAssetList: switch (tabType) { case TabType.App: FilesCsvForStreamingAssets.GeneratorUpdateList(null); break; case TabType.Patch: FilesCsvForStreamingAssets.GeneratorUpdateList(compareVersion); break; } break; } } GUILayout.EndHorizontal(); GUILayout.Space(10); } GUILayout.EndVertical(); } switch (tabType) { case TabType.App: case TabType.Patch: OnGUI_AssetBundleServer(); OnGUI_TestVersionModel(); break; } EditorGUILayout.EndScrollView(); }