This commit is contained in:
BoyongHwang
2026-02-23 17:31:21 +09:00
2 changed files with 13 additions and 0 deletions

View File

@@ -87,6 +87,9 @@ namespace Northbound
private void OnAttack(InputAction.CallbackContext context) private void OnAttack(InputAction.CallbackContext context)
{ {
// UI가 열려있으면 액션 실행 안 함
if (UpgradeListPopup.IsOpen) return;
ExecuteAction("Attack"); ExecuteAction("Attack");
} }

View File

@@ -12,6 +12,10 @@ namespace Northbound
/// </summary> /// </summary>
public class UpgradeListPopup : MonoBehaviour public class UpgradeListPopup : MonoBehaviour
{ {
// 싱글톤 인스턴스 (UI 열림 상태 확인용)
private static UpgradeListPopup _instance;
public static bool IsOpen => _instance != null && _instance.gameObject.activeSelf;
[Header("References")] [Header("References")]
[SerializeField] private Transform _contentParent; [SerializeField] private Transform _contentParent;
[SerializeField] private GameObject _listItemPrefab; [SerializeField] private GameObject _listItemPrefab;
@@ -24,6 +28,8 @@ namespace Northbound
private void Awake() private void Awake()
{ {
_instance = this;
if (_closeButton != null) if (_closeButton != null)
{ {
_closeButton.onClick.AddListener(Close); _closeButton.onClick.AddListener(Close);
@@ -169,6 +175,10 @@ namespace Northbound
private void OnDestroy() private void OnDestroy()
{ {
if (_instance == this)
{
_instance = null;
}
ClearList(); ClearList();
} }
} }