From 78bc7a1db913a038424cb5fac6e75ccccc195cfb Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Apr 2022 17:12:37 +0800 Subject: *misc --- SurvivalTest/Assets/Scripts/Utils/EventCenter.cs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'SurvivalTest/Assets/Scripts/Utils/EventCenter.cs') 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 } } + public void Publish(EventMsgType evt) + { + List handlers; + if (m_EventHandlers.TryGetValue(evt, out handlers)) + { + handlers.ForEach(h => h(null)); + } + } + } \ No newline at end of file -- cgit v1.1-26-g67d0