26 lines
816 B
C#
26 lines
816 B
C#
|
|
using UI.PanelStack;
|
||
|
|
using UnityEngine;
|
||
|
|
|
||
|
|
namespace UI.PanelStack
|
||
|
|
{
|
||
|
|
public class UIActionMapRouter : MonoBehaviour
|
||
|
|
{
|
||
|
|
[SerializeField] private bool debugLogs = true;
|
||
|
|
|
||
|
|
public void OnUICancel()
|
||
|
|
{
|
||
|
|
if (UIPanelStack.Instance == null) { return; }
|
||
|
|
bool closed = UIPanelStack.Instance.CloseTop();
|
||
|
|
if (debugLogs) Debug.Log($"[UIActionMapRouter] UI/Cancel triggered. closedTop={closed}");
|
||
|
|
}
|
||
|
|
|
||
|
|
public void OnUIPause()
|
||
|
|
{
|
||
|
|
if (UIPanelStack.Instance == null) { return; }
|
||
|
|
if (UIPanelStack.Instance.IsAnyOpen()) { return; }
|
||
|
|
bool opened = UIPanelStack.Instance.TryOpenOnEscapeWhenEmpty();
|
||
|
|
if (debugLogs) Debug.Log($"[UIActionMapRouter] UI/Pause triggered. openedMenu={opened}");
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|