Fix UI mouse inspector results panel not always coming to front

This commit is contained in:
Sinai 2022-03-13 02:59:52 +11:00
parent 4fdb2aacd8
commit b5c69fc1ea
2 changed files with 19 additions and 11 deletions

View File

@ -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<UiInspectorResultsPanel>(UIManager.Panels.UIInspectorResults);
panel.SetActive(true);
panel.ShowResults();

View File

@ -108,9 +108,8 @@ namespace UnityExplorer.UI.Panels
public override void SetActive(bool active)
{
if (this.Enabled == active)
return;
if (this.Enabled != active)
{
base.SetActive(active);
if (!ApplyingSaveData)
@ -121,6 +120,7 @@ namespace UnityExplorer.UI.Panels
var color = active ? UniversalUI.EnabledButtonColor : UniversalUI.DisabledButtonColor;
RuntimeHelper.SetColorBlock(NavButton.Component, color, color * 1.2f);
}
}
if (!active)
this.Dragger.WasDragging = false;