diff --git a/src/Inspectors/MouseInspectors/UiInspector.cs b/src/Inspectors/MouseInspectors/UiInspector.cs index 305add2..ff12f38 100644 --- a/src/Inspectors/MouseInspectors/UiInspector.cs +++ b/src/Inspectors/MouseInspectors/UiInspector.cs @@ -1,4 +1,5 @@ using System; +using System.Collections; using System.Collections.Generic; using System.Linq; using System.Text; @@ -8,6 +9,7 @@ using UnityEngine.UI; using UnityExplorer.UI; using UnityExplorer.UI.Panels; using UniverseLib; +using UniverseLib.Input; namespace UnityExplorer.Inspectors.MouseInspectors { @@ -38,6 +40,12 @@ namespace UnityExplorer.Inspectors.MouseInspectors { LastHitObjects.Clear(); LastHitObjects.AddRange(currentHitObjects); + RuntimeHelper.StartCoroutine(SetPanelActiveCoro()); + } + + IEnumerator SetPanelActiveCoro() + { + yield return null; var panel = UIManager.GetPanel(UIManager.Panels.UIInspectorResults); panel.SetActive(true); panel.ShowResults(); diff --git a/src/UI/Panels/UIPanel.cs b/src/UI/Panels/UIPanel.cs index 3f71576..15cc40d 100644 --- a/src/UI/Panels/UIPanel.cs +++ b/src/UI/Panels/UIPanel.cs @@ -108,18 +108,18 @@ namespace UnityExplorer.UI.Panels public override void SetActive(bool active) { - if (this.Enabled == active) - return; - - base.SetActive(active); - - if (!ApplyingSaveData) - SaveInternalData(); - - if (NavButtonWanted) + if (this.Enabled != active) { - var color = active ? UniversalUI.EnabledButtonColor : UniversalUI.DisabledButtonColor; - RuntimeHelper.SetColorBlock(NavButton.Component, color, color * 1.2f); + base.SetActive(active); + + if (!ApplyingSaveData) + SaveInternalData(); + + if (NavButtonWanted) + { + var color = active ? UniversalUI.EnabledButtonColor : UniversalUI.DisabledButtonColor; + RuntimeHelper.SetColorBlock(NavButton.Component, color, color * 1.2f); + } } if (!active)