Fix hidden UiBase not being deactivated with main one

This commit is contained in:
Sinai 2022-01-24 00:35:45 +11:00
parent 177b78f4e7
commit a95d91c824
3 changed files with 4 additions and 1 deletions

View File

@ -10,6 +10,7 @@ using UnityExplorer.ObjectExplorer;
using UnityExplorer.UI.Panels; using UnityExplorer.UI.Panels;
using UnityExplorer.Runtime; using UnityExplorer.Runtime;
using UniverseLib.Input; using UniverseLib.Input;
using UniverseLib.UI;
namespace UnityExplorer namespace UnityExplorer
{ {

View File

@ -41,6 +41,7 @@ namespace UnityExplorer.Inspectors
private static Vector3 lastMousePos; private static Vector3 lastMousePos;
// UIPanel // UIPanel
internal static readonly string UIBaseGUID = $"{ExplorerCore.GUID}.MouseInspector";
private UIBase inspectorUIBase; private UIBase inspectorUIBase;
public override string Name => "Inspect Under Mouse"; public override string Name => "Inspect Under Mouse";
@ -205,7 +206,7 @@ namespace UnityExplorer.Inspectors
// Create a new canvas for this panel to live on. // Create a new canvas for this panel to live on.
// It needs to always be shown on the main display, other panels can move displays. // It needs to always be shown on the main display, other panels can move displays.
inspectorUIBase = UniversalUI.RegisterUI($"{ExplorerCore.GUID}.MouseInspector", null); inspectorUIBase = UniversalUI.RegisterUI(UIBaseGUID, null);
UIRoot.transform.SetParent(inspectorUIBase.RootObject.transform); UIRoot.transform.SetParent(inspectorUIBase.RootObject.transform);
} }
} }

View File

@ -69,6 +69,7 @@ namespace UnityExplorer.UI
return; return;
UniversalUI.SetUIActive(ExplorerCore.GUID, value); UniversalUI.SetUIActive(ExplorerCore.GUID, value);
UniversalUI.SetUIActive(InspectUnderMouse.UIBaseGUID, value);
} }
} }