업그레이드를 위한 클릭 시, 공격이 나가지 않도록 함
This commit is contained in:
@@ -87,6 +87,9 @@ namespace Northbound
|
||||
|
||||
private void OnAttack(InputAction.CallbackContext context)
|
||||
{
|
||||
// UI가 열려있으면 액션 실행 안 함
|
||||
if (UpgradeListPopup.IsOpen) return;
|
||||
|
||||
ExecuteAction("Attack");
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,10 @@ namespace Northbound
|
||||
/// </summary>
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user