레스토랑 글로벌 메세지 컨트롤러 추가
This commit is contained in:
parent
d6dd319b7a
commit
63f8e26cb5
@ -16,6 +16,7 @@ public static class GameEvents
|
||||
public static HideInteractionUiEvent HideInteractionUiEvent = new();
|
||||
|
||||
public static InventoryChangedEvent InventoryChangedEvent = new();
|
||||
public static SmartVariablesDirtyEvent SmartVariablesDirtyEvent = new();
|
||||
}
|
||||
|
||||
public static class RestaurantEvents
|
||||
@ -100,6 +101,11 @@ public class ShowInteractionUiEvent : IEvent
|
||||
|
||||
public class HideInteractionUiEvent : IEvent { }
|
||||
|
||||
public class SmartVariablesDirtyEvent : IEvent
|
||||
{
|
||||
public SmartVariablesDomain DomainFlags;
|
||||
}
|
||||
|
||||
#region RestaurantInteractionEvents
|
||||
|
||||
public class ItemSlotSelectedEvent : IEvent
|
||||
|
@ -0,0 +1,44 @@
|
||||
using System.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
|
||||
namespace DDD
|
||||
{
|
||||
public class RestaurantGlobalMessageController : FlowController
|
||||
{
|
||||
private const string ReadyForRestaurantMessageKey = "ready_for_restaurant_message";
|
||||
private const string RunRestaurantMessageKey = "run_restaurnat_message";
|
||||
|
||||
public override Task InitializeController()
|
||||
{
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public override Task InitializeState()
|
||||
{
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public override Task OnExitCurrentFlow(GameFlowState exitingFlowState)
|
||||
{
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public override Task OnReadyNewFlow(GameFlowState newFlowState)
|
||||
{
|
||||
var evt = GameEvents.ShowGlobalMessageEvent;
|
||||
|
||||
if (newFlowState == GameFlowState.ReadyForRestaurant)
|
||||
{
|
||||
evt.Set(ReadyForRestaurantMessageKey, 3f, newTextColor:Color.yellow, fontSize:60);
|
||||
}
|
||||
else if (newFlowState == GameFlowState.RunRestaurant)
|
||||
{
|
||||
evt.Set(RunRestaurantMessageKey, 3f, newTextColor:Color.yellow, fontSize:60);
|
||||
}
|
||||
|
||||
EventBus.Broadcast(evt);
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user