Initial Unity project commit

This commit is contained in:
2026-07-08 19:53:15 +08:00
commit 75f254212e
15657 changed files with 11633879 additions and 0 deletions
@@ -0,0 +1,35 @@
using UnityEngine;
#if ENABLE_INPUT_SYSTEM
using UnityEngine.InputSystem;
#endif
namespace UI.PanelStack
{
public class UIPanelStackInput : MonoBehaviour
{
[SerializeField] private bool enabledInput = true;
private void Update()
{
if (!enabledInput) { return; }
if (UIPanelStack.Instance == null) { return; }
if (IsEscapePressed())
{
if (!UIPanelStack.Instance.CloseTop())
{
UIPanelStack.Instance.TryOpenOnEscapeWhenEmpty();
}
}
}
private bool IsEscapePressed()
{
#if ENABLE_INPUT_SYSTEM
return Keyboard.current != null && Keyboard.current.escapeKey.wasPressedThisFrame;
#else
return Input.GetKeyDown(KeyCode.Escape);
#endif
}
}
}