mirror of
https://github.com/sinai-dev/UnityExplorer.git
synced 2025-06-15 22:07:48 +08:00
Move logic out of UIManager.SetPanelActive into panel.SetActive
This commit is contained in:
parent
48e688cb75
commit
4fdb2aacd8
@ -39,7 +39,7 @@ namespace UnityExplorer.Inspectors.MouseInspectors
|
|||||||
LastHitObjects.Clear();
|
LastHitObjects.Clear();
|
||||||
LastHitObjects.AddRange(currentHitObjects);
|
LastHitObjects.AddRange(currentHitObjects);
|
||||||
var panel = UIManager.GetPanel<UiInspectorResultsPanel>(UIManager.Panels.UIInspectorResults);
|
var panel = UIManager.GetPanel<UiInspectorResultsPanel>(UIManager.Panels.UIInspectorResults);
|
||||||
UIManager.SetPanelActive(panel, true);
|
panel.SetActive(true);
|
||||||
panel.ShowResults();
|
panel.ShowResults();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -124,6 +124,11 @@ namespace UnityExplorer.UI.Panels
|
|||||||
|
|
||||||
if (!active)
|
if (!active)
|
||||||
this.Dragger.WasDragging = false;
|
this.Dragger.WasDragging = false;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
this.UIRoot.transform.SetAsLastSibling();
|
||||||
|
InvokeOnPanelsReordered();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Destroy()
|
public override void Destroy()
|
||||||
|
@ -184,26 +184,21 @@ namespace UnityExplorer.UI
|
|||||||
SetPanelActive(panel, !uiPanel.Enabled);
|
SetPanelActive(panel, !uiPanel.Enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SetPanelActive(Panels panel, bool active)
|
public static void SetPanelActive(Panels panelType, bool active)
|
||||||
{
|
{
|
||||||
var obj = GetPanel(panel);
|
GetPanel(panelType)
|
||||||
SetPanelActive(obj, active);
|
.SetActive(active);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SetPanelActive(UIPanel panel, bool active)
|
public static void SetPanelActive(UIPanel panel, bool active)
|
||||||
{
|
{
|
||||||
panel.SetActive(active);
|
panel.SetActive(active);
|
||||||
if (active)
|
|
||||||
{
|
|
||||||
panel.UIRoot.transform.SetAsLastSibling();
|
|
||||||
UIPanel.InvokeOnPanelsReordered();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static void SetPanelActive(Transform transform, bool value)
|
internal static void SetPanelActive(Transform transform, bool value)
|
||||||
{
|
{
|
||||||
if (UIPanel.transformToPanelDict.TryGetValue(transform.GetInstanceID(), out UIPanel panel))
|
if (UIPanel.transformToPanelDict.TryGetValue(transform.GetInstanceID(), out UIPanel panel))
|
||||||
SetPanelActive(panel, value);
|
panel.SetActive(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
// navbar
|
// navbar
|
||||||
|
Loading…
x
Reference in New Issue
Block a user