diff --git a/Assets/Scripts/PlayerActionSystem.cs b/Assets/Scripts/PlayerActionSystem.cs index 77a8064..28ca514 100644 --- a/Assets/Scripts/PlayerActionSystem.cs +++ b/Assets/Scripts/PlayerActionSystem.cs @@ -87,6 +87,9 @@ namespace Northbound private void OnAttack(InputAction.CallbackContext context) { + // UI가 열려있으면 액션 실행 안 함 + if (UpgradeListPopup.IsOpen) return; + ExecuteAction("Attack"); } diff --git a/Assets/Scripts/UI/UpgradeListPopup.cs b/Assets/Scripts/UI/UpgradeListPopup.cs index 6527d3b..13701e0 100644 --- a/Assets/Scripts/UI/UpgradeListPopup.cs +++ b/Assets/Scripts/UI/UpgradeListPopup.cs @@ -12,6 +12,10 @@ namespace Northbound /// public class UpgradeListPopup : MonoBehaviour { + // 싱글톤 인스턴스 (UI 열림 상태 확인용) + private static UpgradeListPopup _instance; + public static bool IsOpen => _instance != null && _instance.gameObject.activeSelf; + [Header("References")] [SerializeField] private Transform _contentParent; [SerializeField] private GameObject _listItemPrefab; @@ -24,6 +28,8 @@ namespace Northbound private void Awake() { + _instance = this; + if (_closeButton != null) { _closeButton.onClick.AddListener(Close); @@ -169,6 +175,10 @@ namespace Northbound private void OnDestroy() { + if (_instance == this) + { + _instance = null; + } ClearList(); } }