From ff74dcdd8b5e2bd452b0fdd95efe42e8ba34ba74 Mon Sep 17 00:00:00 2001 From: L <401419353@qq.com> Date: Tue, 26 Apr 2022 19:41:06 +0800 Subject: [PATCH] All YooAsset Window Auto Dock --- .../Editor/AssetBundleBuilder/AssetBundleBuilderWindow.cs | 3 +-- .../Editor/AssetBundleDebugger/AssetBundleDebuggerWindow.cs | 3 +-- .../Editor/AssetBundleGrouper/AssetBundleGrouperWindow.cs | 3 +-- .../Editor/AssetBundleReporter/AssetBundleReporterWindow.cs | 3 +-- Assets/YooAsset/Editor/EditorDefine.cs | 4 ++++ .../ShaderVariantCollector/ShaderVariantCollectorWindow.cs | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilderWindow.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilderWindow.cs index b1af25d..46ee149 100644 --- a/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilderWindow.cs +++ b/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilderWindow.cs @@ -14,8 +14,7 @@ namespace YooAsset.Editor [MenuItem("YooAsset/AssetBundle Builder", false, 102)] public static void ShowExample() { - AssetBundleBuilderWindow window = GetWindow(); - window.titleContent = new GUIContent("资源包构建工具"); + AssetBundleBuilderWindow window = GetWindow("资源包构建工具", true, EditorDefine.DockedWindowTypes); window.minSize = new Vector2(800, 600); } diff --git a/Assets/YooAsset/Editor/AssetBundleDebugger/AssetBundleDebuggerWindow.cs b/Assets/YooAsset/Editor/AssetBundleDebugger/AssetBundleDebuggerWindow.cs index 056a31d..e457939 100644 --- a/Assets/YooAsset/Editor/AssetBundleDebugger/AssetBundleDebuggerWindow.cs +++ b/Assets/YooAsset/Editor/AssetBundleDebugger/AssetBundleDebuggerWindow.cs @@ -11,8 +11,7 @@ namespace YooAsset.Editor [MenuItem("YooAsset/AssetBundle Debugger", false, 104)] public static void ShowExample() { - AssetBundleDebuggerWindow wnd = GetWindow(); - wnd.titleContent = new GUIContent("资源包调试工具"); + AssetBundleDebuggerWindow wnd = GetWindow("资源包调试工具", true, EditorDefine.DockedWindowTypes); wnd.minSize = new Vector2(800, 600); } diff --git a/Assets/YooAsset/Editor/AssetBundleGrouper/AssetBundleGrouperWindow.cs b/Assets/YooAsset/Editor/AssetBundleGrouper/AssetBundleGrouperWindow.cs index b0dda56..fc70fb9 100644 --- a/Assets/YooAsset/Editor/AssetBundleGrouper/AssetBundleGrouperWindow.cs +++ b/Assets/YooAsset/Editor/AssetBundleGrouper/AssetBundleGrouperWindow.cs @@ -14,8 +14,7 @@ namespace YooAsset.Editor [MenuItem("YooAsset/AssetBundle Grouper", false, 101)] public static void ShowExample() { - AssetBundleGrouperWindow window = GetWindow(); - window.titleContent = new GUIContent("资源包分组工具"); + AssetBundleGrouperWindow window = GetWindow("资源包分组工具", true, EditorDefine.DockedWindowTypes); window.minSize = new Vector2(800, 600); } diff --git a/Assets/YooAsset/Editor/AssetBundleReporter/AssetBundleReporterWindow.cs b/Assets/YooAsset/Editor/AssetBundleReporter/AssetBundleReporterWindow.cs index b55f0f7..394bba0 100644 --- a/Assets/YooAsset/Editor/AssetBundleReporter/AssetBundleReporterWindow.cs +++ b/Assets/YooAsset/Editor/AssetBundleReporter/AssetBundleReporterWindow.cs @@ -11,8 +11,7 @@ namespace YooAsset.Editor [MenuItem("YooAsset/AssetBundle Reporter", false, 103)] public static void ShowExample() { - AssetBundleReporterWindow window = GetWindow(); - window.titleContent = new GUIContent("资源包报告工具"); + AssetBundleReporterWindow window = GetWindow("资源包报告工具", true, EditorDefine.DockedWindowTypes); window.minSize = new Vector2(800, 600); } diff --git a/Assets/YooAsset/Editor/EditorDefine.cs b/Assets/YooAsset/Editor/EditorDefine.cs index 6ec6967..2fed369 100644 --- a/Assets/YooAsset/Editor/EditorDefine.cs +++ b/Assets/YooAsset/Editor/EditorDefine.cs @@ -1,4 +1,6 @@  +using System; + namespace YooAsset.Editor { public class EditorDefine @@ -12,6 +14,8 @@ namespace YooAsset.Editor /// 资源包分组工具的配置文件存储路径 /// public const string AssetBundleGrouperSettingFilePath = "Assets/YooAssetSetting/AssetBundleGrouperSetting.asset"; + + public static readonly Type[] DockedWindowTypes = { typeof(AssetBundleBuilderWindow), typeof(AssetBundleGrouperWindow), typeof(AssetBundleDebuggerWindow), typeof(AssetBundleReporterWindow) , typeof(ShaderVariantCollectionWindow)}; } /// diff --git a/Assets/YooAsset/Editor/ShaderVariantCollector/ShaderVariantCollectorWindow.cs b/Assets/YooAsset/Editor/ShaderVariantCollector/ShaderVariantCollectorWindow.cs index eaea085..a34b33b 100644 --- a/Assets/YooAsset/Editor/ShaderVariantCollector/ShaderVariantCollectorWindow.cs +++ b/Assets/YooAsset/Editor/ShaderVariantCollector/ShaderVariantCollectorWindow.cs @@ -12,7 +12,7 @@ namespace YooAsset.Editor { if (_thisInstance == null) { - _thisInstance = EditorWindow.GetWindow(typeof(ShaderVariantCollectionWindow), false, "着色器变种收集工具", true) as ShaderVariantCollectionWindow; + _thisInstance = GetWindow("ShaderVariant Collector", true, EditorDefine.DockedWindowTypes); _thisInstance.minSize = new Vector2(800, 600); } _thisInstance.Show();