diff options
author | chai <chaifix@163.com> | 2022-04-25 17:12:37 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2022-04-25 17:12:37 +0800 |
commit | 78bc7a1db913a038424cb5fac6e75ccccc195cfb (patch) | |
tree | 9b5c3c483985f53736bc2de21bb8fbc3649b161e /SurvivalTest/Assets/Scripts/Utils/EventCenter.cs | |
parent | cce2815f3bcfeec2f4c13386d073d20778724656 (diff) |
*misc
Diffstat (limited to 'SurvivalTest/Assets/Scripts/Utils/EventCenter.cs')
-rw-r--r-- | SurvivalTest/Assets/Scripts/Utils/EventCenter.cs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/SurvivalTest/Assets/Scripts/Utils/EventCenter.cs b/SurvivalTest/Assets/Scripts/Utils/EventCenter.cs index eef3646..39b7909 100644 --- a/SurvivalTest/Assets/Scripts/Utils/EventCenter.cs +++ b/SurvivalTest/Assets/Scripts/Utils/EventCenter.cs @@ -45,4 +45,13 @@ public class EventCenter : Singleton<EventCenter> } } + public void Publish(EventMsgType evt) + { + List<EventHandler> handlers; + if (m_EventHandlers.TryGetValue(evt, out handlers)) + { + handlers.ForEach(h => h(null)); + } + } + }
\ No newline at end of file |