diff --git a/Assets/_DDD/_Scripts/GameEvent.meta b/Assets/_DDD/_Scripts/GameEvent.meta new file mode 100644 index 000000000..df92d4ebe --- /dev/null +++ b/Assets/_DDD/_Scripts/GameEvent.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 75d0cfe071ff4a50b1cb68d5a3e6822f +timeCreated: 1752739468 \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GameEvent/GameEvents.cs b/Assets/_DDD/_Scripts/GameEvent/GameEvents.cs new file mode 100644 index 000000000..dfe7870c7 --- /dev/null +++ b/Assets/_DDD/_Scripts/GameEvent/GameEvents.cs @@ -0,0 +1,19 @@ +namespace DDD +{ + public static class GameEvents + { + // public static GameGlobalEvent GameGlobalEvent = new GameGlobalEvent(); + } + public static class RestaurantEvents + { + + } + public static class VoyageEvents + { + + } + + // public class GameGlobalEvent : IEvent + // { + // } +} \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GameEvent/GameEvents.cs.meta b/Assets/_DDD/_Scripts/GameEvent/GameEvents.cs.meta new file mode 100644 index 000000000..2b3c737bc --- /dev/null +++ b/Assets/_DDD/_Scripts/GameEvent/GameEvents.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: 388fe30817e644c29f8b7e71e923c1cc +timeCreated: 1752739530 \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GameFramework/EventBus/EventBus.cs b/Assets/_DDD/_Scripts/GameFramework/EventBus/EventBus.cs index 15a8f5d2c..56ea0f779 100644 --- a/Assets/_DDD/_Scripts/GameFramework/EventBus/EventBus.cs +++ b/Assets/_DDD/_Scripts/GameFramework/EventBus/EventBus.cs @@ -32,14 +32,14 @@ public static void Unregister(IEventHandler handler) where T : IEvent } } - public static void Publish(T evt) where T : IEvent + public static void Broadcast(T evt) where T : IEvent { var type = typeof(T); if (HandlerDictionary.TryGetValue(type, out var list)) { foreach (var handler in list.Cast>()) { - handler.Handle(evt); + handler.Invoke(evt); } } } diff --git a/Assets/_DDD/_Scripts/GameFramework/EventBus/IEventHandler.cs b/Assets/_DDD/_Scripts/GameFramework/EventBus/IEventHandler.cs index eb26c0f31..2239da7c0 100644 --- a/Assets/_DDD/_Scripts/GameFramework/EventBus/IEventHandler.cs +++ b/Assets/_DDD/_Scripts/GameFramework/EventBus/IEventHandler.cs @@ -2,6 +2,6 @@ namespace DDD { public interface IEventHandler where T : IEvent { - void Handle(T evt); + void Invoke(T evt); } } \ No newline at end of file diff --git a/Assets/_DDD/_Scripts/GameFramework/GameManager.cs b/Assets/_DDD/_Scripts/GameFramework/GameManager.cs index cf3b1ceff..5e14991f2 100644 --- a/Assets/_DDD/_Scripts/GameFramework/GameManager.cs +++ b/Assets/_DDD/_Scripts/GameFramework/GameManager.cs @@ -19,6 +19,8 @@ protected void Start() Debug.LogError("_managerDefinitionSo"); return; } + + EventBus.ClearAll(); // 매니저 초기화 _managerInstances = new List(_managerDefinitionSo.ManagerClasses.Count);