/** 开发 */
        void OnGUI_Develop()
        {
            HGUILayout.BeginCenterHorizontal();
            if (GUILayout.Button("生成版本信息", GUILayout.MinHeight(50), GUILayout.MaxWidth(200)))
            {
                if (currentDvancedSettingData.GetValue(DvancedSettingType.GameConstConfig))
                {
                    GameConstConfig config = GameConstConfig.Load();
                    config.DevelopMode     = true;
                    config.TestVersionMode = false;
                    config.Save();
                }


                if (currentDvancedSettingData.GetValue(DvancedSettingType.Clear_AssetBundleName))
                {
                    AssetBundleEditor.ClearAssetBundleNames();
                    AssetDatabase.RemoveUnusedAssetBundleNames();
                }


                if (currentDvancedSettingData.GetValue(DvancedSettingType.Set_AssetBundleName))
                {
                    AssetBundleEditor.SetNames_Develop();
                }

                if (currentDvancedSettingData.GetValue(DvancedSettingType.GeneratorLoadAssetListCsv))
                {
                    LoadAssetListCsv.Generator();
                }
            }
            HGUILayout.EndCenterHorizontal();
        }
Example #2
0
        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:
                            switch (tabType)
                            {
                            case TabType.Develop:
                                AssetBundleEditor.SetNames_Develop();
                                break;

                            default:
                                AssetBundleEditor.SetNames();
                                break;
                            }

                            break;


                        case DvancedSettingType.AB_AssetBundle:
                            AssetBundleEditor.BuildAssetBundles();
                            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:
                            FilesCsvForStreamingAssets.Generator();
                            break;


                        case DvancedSettingType.GeneratorLoadAssetListCsv:
                            LoadAssetListCsv.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();
        }