ProjectDDD/Assets/_DDD/_Scripts/RestaurantEvent/Solvers/RestaurantManagementUiEventSolver.cs

24 lines
889 B
C#
Raw Normal View History

using UnityEngine;
namespace DDD
{
public class RestaurantManagementUiEventSolver : MonoBehaviour, IInteractionSolver
{
public bool ExecuteInteraction(IInteractor interactor, IInteractable interactable, ScriptableObject payloadSo = null)
{
2025-08-07 08:51:36 +00:00
if (CanExecuteInteraction() == false) return false;
var evt = GameEvents.OpenPopupUiEvent;
evt.UiType = typeof(RestaurantManagementUi);
EventBus.Broadcast(evt);
return true;
}
public bool CanExecuteInteraction(IInteractor interactor = null, IInteractable interactable = null,
ScriptableObject payloadSo = null)
{
GameFlowState currentGameFlowState = GameFlowManager.Instance.GameFlowDataSo.CurrentGameState;
return currentGameFlowState == GameFlowState.ReadyForRestaurant;
}
}
}