solver 수정 및 오픈 레스토랑 solver 추가
This commit is contained in:
parent
a778a9d58c
commit
a265bd3440
@ -6,12 +6,18 @@ public class RestaurantManagementUiEventSolver : MonoBehaviour, IInteractionSolv
|
|||||||
{
|
{
|
||||||
public bool ExecuteInteraction(IInteractor interactor, IInteractable interactable, ScriptableObject interactionPayloadSo = null)
|
public bool ExecuteInteraction(IInteractor interactor, IInteractable interactable, ScriptableObject interactionPayloadSo = null)
|
||||||
{
|
{
|
||||||
GameFlowState currentGameFlowState = GameFlowManager.Instance.GameFlowDataSo.CurrentGameState;
|
if (CanInteract() == false) return false;
|
||||||
if (currentGameFlowState != GameFlowState.ReadyForRestaurant) return false;
|
|
||||||
var evt = GameEvents.OpenPopupUiEvent;
|
var evt = GameEvents.OpenPopupUiEvent;
|
||||||
evt.UiType = typeof(RestaurantManagementUi);
|
evt.UiType = typeof(RestaurantManagementUi);
|
||||||
EventBus.Broadcast(evt);
|
EventBus.Broadcast(evt);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool CanInteract()
|
||||||
|
{
|
||||||
|
GameFlowState currentGameFlowState = GameFlowManager.Instance.GameFlowDataSo.CurrentGameState;
|
||||||
|
return currentGameFlowState == GameFlowState.ReadyForRestaurant;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace DDD
|
||||||
|
{
|
||||||
|
public class RestaurantOpenEventSolver : MonoBehaviour, IInteractionSolver
|
||||||
|
{
|
||||||
|
public bool ExecuteInteraction(IInteractor interactor, IInteractable interactable, ScriptableObject interactionPayloadSo = null)
|
||||||
|
{
|
||||||
|
if (CanInteract() == false) return false;
|
||||||
|
|
||||||
|
GameFlowManager.Instance.ChangeFlow(GameFlowState.RunRestaurant);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool CanInteract()
|
||||||
|
{
|
||||||
|
GameFlowState currentGameFlowState = GameFlowManager.Instance.GameFlowDataSo.CurrentGameState;
|
||||||
|
return currentGameFlowState == GameFlowState.ReadyForRestaurant;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user