From 63f8e26cb5ed181f82afa7a6166c83cbe39e2b0f Mon Sep 17 00:00:00 2001 From: NTG Date: Sun, 17 Aug 2025 21:55:49 +0900 Subject: [PATCH] =?UTF-8?q?=EB=A0=88=EC=8A=A4=ED=86=A0=EB=9E=91=20?= =?UTF-8?q?=EA=B8=80=EB=A1=9C=EB=B2=8C=20=EB=A9=94=EC=84=B8=EC=A7=80=20?= =?UTF-8?q?=EC=BB=A8=ED=8A=B8=EB=A1=A4=EB=9F=AC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/_DDD/_Scripts/GameEvent/GameEvents.cs | 6 +++ .../RestaurantGlobalMessageController.cs | 44 +++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 Assets/_DDD/_Scripts/RestaurantController/Conrtollers/RestaurantGlobalMessageController.cs diff --git a/Assets/_DDD/_Scripts/GameEvent/GameEvents.cs b/Assets/_DDD/_Scripts/GameEvent/GameEvents.cs index da884fb3a..dff8b3c0c 100644 --- a/Assets/_DDD/_Scripts/GameEvent/GameEvents.cs +++ b/Assets/_DDD/_Scripts/GameEvent/GameEvents.cs @@ -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 diff --git a/Assets/_DDD/_Scripts/RestaurantController/Conrtollers/RestaurantGlobalMessageController.cs b/Assets/_DDD/_Scripts/RestaurantController/Conrtollers/RestaurantGlobalMessageController.cs new file mode 100644 index 000000000..e43fa0310 --- /dev/null +++ b/Assets/_DDD/_Scripts/RestaurantController/Conrtollers/RestaurantGlobalMessageController.cs @@ -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; + } + } +} \ No newline at end of file