Files
Echo/Assets/_Project/Scripts/UI/PanelStack/UIActionMapRouter.cs
T

26 lines
816 B
C#
Raw Normal View History

2026-07-08 19:53:15 +08:00
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}");
}
}
}