public override void OnGUI(string searchContext) { base.OnGUI(searchContext); LightmapAttachSetting setting = LightmapAttachSetting.GetInstance(); EditorGUILayout.BeginHorizontal(); if (GUILayout.Button("保存")) { LightmapAttachSetting.GetInstance().Save(); m_ExporterFileNameTypeChanged = false; } EditorGUILayout.EndHorizontal(); setting.ExporterFolder = (EGLUtility.Folder("导出设置保存目录", setting.ExporterFolder)); if (m_ExporterFileNameTypeChanged) { EditorGUILayout.HelpBox("修改这项设置,会导致之前的导出设置丢失场景的索引。" , MessageType.Warning); } if (EGLUtility.EnumPopup(out setting.ExporterFileNameType , "导出设置文件名" , setting.ExporterFileNameType)) { m_ExporterFileNameTypeChanged = true; } }
public override void OnGUI(string searchContext) { base.OnGUI(searchContext); AssetVersionSetting setting = AssetVersionSetting.GetInstance(); EditorGUILayout.BeginHorizontal(); if (GUILayout.Button("保存")) { setting.Save(); } if (GUILayout.Button("生成资源版本文件")) { AssetVersionBuilder.GenerateAssetVersionFile(); } EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(); if (EGLUtility.Folder(out setting.AssetVersionFilePath , "资源版本文件路径" , setting.AssetVersionFilePath)) { m_FormatedVersionFilePath = setting.GetFormatedAssetVersionFilePath(); } EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("资源版本文件路径", m_FormatedVersionFilePath); if (GUILayout.Button("打开", GUILayout.Width(36))) { EditorUtility.RevealInFinder(m_FormatedVersionFilePath); } EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(); }
public override void OnGUI() { OnGUI_Base(); EditorGUILayout.HelpBox("可用的Format标记有:\n" + "{Application.dataPath}\n" + "{DateTime.Now}" , MessageType.Info); if (EGLUtility.Folder(out ReportDirectory, "报告目录", ReportDirectory)) { m_ReportDirectoryFormated = FormatReportDirectory(); } EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("Format报告目录", m_ReportDirectoryFormated); if (GUILayout.Button("打开", GUILayout.Width(32))) { DirectoryInfo directory = new DirectoryInfo(m_ReportDirectoryFormated); while (!Directory.Exists(directory.FullName)) { if (directory.Parent != null) { directory = directory.Parent; break; } } if (Directory.Exists(directory.FullName)) { EditorUtility.RevealInFinder(directory.FullName); } } EditorGUILayout.EndHorizontal(); }
public override void OnGUI(string searchContext) { base.OnGUI(searchContext); XLuaSetting setting = XLuaSetting.GetInstance(); EditorGUILayout.BeginHorizontal(); if (GUILayout.Button("保存")) { XLuaSetting.GetInstance().Save(); } if (GUILayout.Button("重新导入所有Lua脚本")) { LuaScriptPostprocessor.ReimportAllLuaScript(); } EditorGUILayout.EndHorizontal(); setting.ExportedLuaRoot = (EGLUtility.Folder("Lua的导出目录", setting.ExportedLuaRoot)); }
public override void OnInspectorGUI() { serializedObject.Update(); m_Rule._OnInspectorGUI(); m_Rule.RootPath = EGLUtility.Folder("目录", m_Rule.RootPath); m_Rule.AssetCollectionFoldout = EditorGUILayout.Foldout(m_Rule.AssetCollectionFoldout, "收集资源"); if (m_Rule.AssetCollectionFoldout) { EditorGUI.indentLevel++; OnInspectorGUI_AssetCollection(); EditorGUI.indentLevel--; } EditorGUILayout.Space(); m_Rule.AssetFilterFoldout = EditorGUILayout.Foldout(m_Rule.AssetFilterFoldout, "筛选资源"); if (m_Rule.AssetFilterFoldout) { EditorGUI.indentLevel++; OnInspectorGUI_AssetFilter(); EditorGUI.indentLevel--; } EditorGUILayout.Space(); m_Rule.BundleNameAndAssetKeyFoldout = EditorGUILayout.Foldout(m_Rule.BundleNameAndAssetKeyFoldout, "BundleName & AssetKey"); if (m_Rule.BundleNameAndAssetKeyFoldout) { EditorGUI.indentLevel++; OnInspectorGUI_BundleNameAndAssetKey(); EditorGUI.indentLevel--; } EditorGUILayout.Space(); GUI.enabled = true; if (GUI.changed) { serializedObject.ApplyModifiedProperties(); EditorUtility.SetDirty(target); } }
public override void OnGUI(string searchContext) { base.OnGUI(searchContext); BuildSetting setting = BuildSetting.GetInstance(); EditorGUILayout.BeginHorizontal(); if (GUILayout.Button("保存")) { BuildSetting.GetInstance().Save(); } if (GUILayout.Button("清除BundleName")) { Builder.ClearAllBundleName(); } if (GUILayout.Button("打包")) { BuildSetting.GetInstance().Save(); Builder.Build(); } EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(); EditorGUILayout.HelpBox("打包目录和BundleName路径支持Format: \n" + "\t{Application.dataPath}\n" + "\t{BuildTarget}" , MessageType.Info); if (EGLUtility.Folder(out setting.BuildOutput , "打包目录" , setting.BuildOutput)) { m_FormatedBuildOutput = BuildSetting.GetInstance().GetFormatedBuildOutput(); } EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("打包目录", m_FormatedBuildOutput); if (GUILayout.Button("打开", GUILayout.Width(36))) { EditorUtility.RevealInFinder(m_FormatedBuildOutput); } EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(); if (EGLUtility.Folder(out setting.BundleBuildsPath , "BundleName路径" , setting.BundleBuildsPath)) { m_FormatedBundleBuildsPath = BuildSetting.GetInstance().GetFormatedBundleBuildsPath(); } EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("BundleName路径", m_FormatedBundleBuildsPath); if (GUILayout.Button("打开", GUILayout.Width(36))) { EditorUtility.RevealInFinder(m_FormatedBundleBuildsPath); EditorUtility.OpenWithDefaultApp(m_FormatedBundleBuildsPath); } EditorGUILayout.EndHorizontal(); if (EGLUtility.Folder(out setting.BundleInfoPath , "BundleInfo路径" , setting.BundleInfoPath)) { m_FormatedBundleInfoPath = BuildSetting.GetInstance().GetFormatedBundleInfoPath(); } EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("BundleInfo路径", m_FormatedBundleInfoPath); if (GUILayout.Button("打开", GUILayout.Width(36))) { EditorUtility.RevealInFinder(m_FormatedBundleInfoPath); EditorUtility.OpenWithDefaultApp(m_FormatedBundleInfoPath); } EditorGUILayout.EndHorizontal(); EditorGUILayout.HelpBox("开启这个选项可以加快打包速度\n" + "如果本地有之前缓存的BundleName文件就不在打包前执行打包规则\n" + "当需要打包的资源有增加或移除,则不应开启这个选项" , MessageType.Info); setting.UseCachedBuild = EditorGUILayout.Toggle("使用缓存的BundleName", setting.UseCachedBuild); EditorGUILayout.Space(); EditorGUILayout.HelpBox("关闭这个选项可以加快打包速度\n" + "但是有些插件和调试工具必须设置BundleName才能使用\n\n" + "例如AssetBundleBrowser\n" + "可以通过这个工具设置BundleName,但是不勾选打包AB的选项。然后通过AssetBundleBrowser打包" , MessageType.Info); setting.ResetBundleName = EditorGUILayout.Toggle("设置BundleName", setting.ResetBundleName); EditorGUILayout.Space(); if (EGLUtility.Folder(out setting.AssetInfosPath , "AssetInfos路径" , setting.AssetInfosPath)) { m_FormatedAssetInfosPath = BuildSetting.GetInstance().GetFormateAssetInfosPath(); } EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("AssetInfos路径", m_FormatedAssetInfosPath); if (GUILayout.Button("打开", GUILayout.Width(36))) { EditorUtility.RevealInFinder(m_FormatedAssetInfosPath); EditorUtility.OpenWithDefaultApp(m_FormatedAssetInfosPath); } EditorGUILayout.EndHorizontal(); if (EGLUtility.Folder(out setting.AssetKeyEnumFilePath , "AssetKeyEnum路径" , setting.AssetKeyEnumFilePath)) { m_FormatedAssetKeyEnumFilePath = BuildSetting.GetInstance().GetFormateAssetKeyEnumFilePath(); } EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField("AssetKeyEnum路径", m_FormatedAssetKeyEnumFilePath); if (GUILayout.Button("打开", GUILayout.Width(36))) { EditorUtility.RevealInFinder(m_FormatedAssetKeyEnumFilePath); } EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(); setting.BuildAssetBundleOptions = (BuildAssetBundleOptions)EditorGUILayout.EnumFlagsField("打包选项", setting.BuildAssetBundleOptions); setting.BuildAssetBuild = EditorGUILayout.Toggle("打包AB", setting.BuildAssetBuild); setting.DeleteOutputBeforeBuild = EditorGUILayout.Toggle("打包前删除上次的AB", setting.DeleteOutputBeforeBuild); }