메뉴 ui 상호작용 조건 추가
This commit is contained in:
parent
65f2f17752
commit
57938a0966
@ -10,26 +10,35 @@ public class PlayerInput : MonoBehaviour
|
||||
private void Start()
|
||||
{
|
||||
_playerDataSo = RestaurantData.Instance.PlayerData;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
_playerDataSo.OpenManagementUiAction = InputManager.Instance.GetAction(InputActionMaps.Restaurant, nameof(RestaurantActions.OpenManagementUi));
|
||||
|
||||
_playerDataSo.OpenManagementUiAction.performed += OnOpenManagementUi;
|
||||
#endif
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
if (!_playerDataSo) return;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
_playerDataSo.OpenManagementUiAction.performed -= OnOpenManagementUi;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
private void OnOpenManagementUi(InputAction.CallbackContext context)
|
||||
{
|
||||
if (context.performed)
|
||||
{
|
||||
if (GameFlowManager.Instance.GameFlowDataSo.CurrentGameState != GameFlowState.ReadyForRestaurant) return;
|
||||
|
||||
var evt = GameEvents.OpenPopupUiEvent;
|
||||
evt.UiType = typeof(RestaurantManagementUi);
|
||||
EventBus.Broadcast(evt);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
Loading…
Reference in New Issue
Block a user