Merge pull request #7 from LiuOcean/main

后续打开的窗口会自动找到 YooAsset 已存在的 Window Dock
pull/9/head
何冠峰 2022-04-28 17:43:59 +08:00 committed by GitHub
commit a4b098084d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 9 additions and 9 deletions

View File

@ -14,8 +14,7 @@ namespace YooAsset.Editor
[MenuItem("YooAsset/AssetBundle Builder", false, 102)]
public static void ShowExample()
{
AssetBundleBuilderWindow window = GetWindow<AssetBundleBuilderWindow>();
window.titleContent = new GUIContent("资源包构建工具");
AssetBundleBuilderWindow window = GetWindow<AssetBundleBuilderWindow>("资源包构建工具", true, EditorDefine.DockedWindowTypes);
window.minSize = new Vector2(800, 600);
}

View File

@ -11,8 +11,7 @@ namespace YooAsset.Editor
[MenuItem("YooAsset/AssetBundle Debugger", false, 104)]
public static void ShowExample()
{
AssetBundleDebuggerWindow wnd = GetWindow<AssetBundleDebuggerWindow>();
wnd.titleContent = new GUIContent("资源包调试工具");
AssetBundleDebuggerWindow wnd = GetWindow<AssetBundleDebuggerWindow>("资源包调试工具", true, EditorDefine.DockedWindowTypes);
wnd.minSize = new Vector2(800, 600);
}

View File

@ -14,8 +14,7 @@ namespace YooAsset.Editor
[MenuItem("YooAsset/AssetBundle Grouper", false, 101)]
public static void ShowExample()
{
AssetBundleGrouperWindow window = GetWindow<AssetBundleGrouperWindow>();
window.titleContent = new GUIContent("资源包分组工具");
AssetBundleGrouperWindow window = GetWindow<AssetBundleGrouperWindow>("资源包分组工具", true, EditorDefine.DockedWindowTypes);
window.minSize = new Vector2(800, 600);
}

View File

@ -11,8 +11,7 @@ namespace YooAsset.Editor
[MenuItem("YooAsset/AssetBundle Reporter", false, 103)]
public static void ShowExample()
{
AssetBundleReporterWindow window = GetWindow<AssetBundleReporterWindow>();
window.titleContent = new GUIContent("资源包报告工具");
AssetBundleReporterWindow window = GetWindow<AssetBundleReporterWindow>("资源包报告工具", true, EditorDefine.DockedWindowTypes);
window.minSize = new Vector2(800, 600);
}

View File

@ -1,4 +1,6 @@

using System;
namespace YooAsset.Editor
{
public class EditorDefine
@ -12,6 +14,8 @@ namespace YooAsset.Editor
/// 资源包分组工具的配置文件存储路径
/// </summary>
public const string AssetBundleGrouperSettingFilePath = "Assets/YooAssetSetting/AssetBundleGrouperSetting.asset";
public static readonly Type[] DockedWindowTypes = { typeof(AssetBundleBuilderWindow), typeof(AssetBundleGrouperWindow), typeof(AssetBundleDebuggerWindow), typeof(AssetBundleReporterWindow) , typeof(ShaderVariantCollectionWindow)};
}
/// <summary>

View File

@ -12,7 +12,7 @@ namespace YooAsset.Editor
{
if (_thisInstance == null)
{
_thisInstance = EditorWindow.GetWindow(typeof(ShaderVariantCollectionWindow), false, "着色器变种收集工具", true) as ShaderVariantCollectionWindow;
_thisInstance = GetWindow<ShaderVariantCollectionWindow>("ShaderVariant Collector", true, EditorDefine.DockedWindowTypes);
_thisInstance.minSize = new Vector2(800, 600);
}
_thisInstance.Show();