架构大更
This commit is contained in:
@@ -6,6 +6,7 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
using UnityEditor;
|
||||
using UnityEditor.ShortcutManagement;
|
||||
using UnityEngine;
|
||||
|
||||
namespace WingmanInspector {
|
||||
@@ -99,7 +100,7 @@ namespace WingmanInspector {
|
||||
private static void SubscribeToCallbacks() {
|
||||
EditorApplication.update -= RefreshInspectorWindows;
|
||||
EditorApplication.update += RefreshInspectorWindows;
|
||||
|
||||
|
||||
EditorApplication.update -= Update;
|
||||
EditorApplication.update += Update;
|
||||
|
||||
@@ -111,7 +112,7 @@ namespace WingmanInspector {
|
||||
|
||||
EditorApplication.quitting -= OnQuit;
|
||||
EditorApplication.quitting += OnQuit;
|
||||
|
||||
|
||||
Settings.OnSettingsChanged += OnSettingsChanged;
|
||||
}
|
||||
|
||||
@@ -123,7 +124,7 @@ namespace WingmanInspector {
|
||||
EditorApplication.quitting -= OnQuit;
|
||||
Settings.OnSettingsChanged -= OnSettingsChanged;
|
||||
}
|
||||
|
||||
|
||||
private static void RefreshInspectorWindows() {
|
||||
IList windows = (IList)allInspectorsFieldInfo.GetValue(inspectorWindowType);
|
||||
|
||||
@@ -135,7 +136,7 @@ namespace WingmanInspector {
|
||||
// Add new window as a container to the list
|
||||
foreach (EditorWindow inspectorWindow in windows) {
|
||||
if (!InspectorHasContainer(inspectorWindow)) {
|
||||
containers.Add(new WingmanContainer(inspectorWindow, Selection.activeObject));
|
||||
containers.Add(new WingmanContainer(inspectorWindow));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,7 +156,7 @@ namespace WingmanInspector {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
private static void OnSelectionChanged() {
|
||||
foreach (WingmanContainer container in containers) {
|
||||
if (!container.InspectorIsLocked()) {
|
||||
@@ -177,6 +178,15 @@ namespace WingmanInspector {
|
||||
container.OnHierarchyGUI();
|
||||
}
|
||||
}
|
||||
|
||||
[Shortcut("Wingman/Toggle Component", KeyCode.A)]
|
||||
private static void ToggleComponentShortcut() {
|
||||
foreach (WingmanContainer container in containers) {
|
||||
if (container.IsFocused) {
|
||||
container.PerformShortcutOperation(WingmanContainer.ShortcutOperation.ToggleComponent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void CheckForPersistent() {
|
||||
if (persistentData) return;
|
||||
|
||||
Reference in New Issue
Block a user