public static void TriggerEvent(string eventName, Hashtable eventParams = default(Hashtable)) { EventHashtable thisEvent = null; if (instance.eventDictionary.TryGetValue(eventName, out thisEvent)) { thisEvent.Invoke(eventParams); } }
public static void StopListening(string eventName, UnityAction <Hashtable> listener) { if (eventManager == null) { return; } EventHashtable thisEvent = null; if (instance.eventDictionary.TryGetValue(eventName, out thisEvent)) { thisEvent.RemoveListener(listener); } }
public static void StartListening(string eventName, UnityAction <Hashtable> listener) { EventHashtable thisEvent = null; if (instance.eventDictionary.TryGetValue(eventName, out thisEvent)) { thisEvent.AddListener(listener); } else { thisEvent = new EventHashtable(); thisEvent.AddListener(listener); instance.eventDictionary.Add(eventName, thisEvent); } }
private void PrepareEmailLogEntryList() { if (_logHashtable == null) { lock (_syncEmailList) { if (_logHashtable != null) { return; } _logHashtable = new Dictionary <string, Dictionary <int, bool> >(); if (EmailSetting.LogsForEmail.LogEntryList == null) { return; } foreach (var logEntry in this.EmailSetting.LogsForEmail.LogEntryList) { EventHashtable eventHashtable; var needNew = !_logHashtable.TryGetValue(logEntry.Category, out eventHashtable); if (needNew) { eventHashtable = new EventHashtable(); } eventHashtable[logEntry.EventId] = true; if (needNew) { _logHashtable[logEntry.Category] = eventHashtable; } } } } }