示例#1
0
    public static void TriggerEvent(string eventName, Hashtable eventParams = default(Hashtable))
    {
        EventHashtable thisEvent = null;

        if (instance.eventDictionary.TryGetValue(eventName, out thisEvent))
        {
            thisEvent.Invoke(eventParams);
        }
    }
示例#2
0
    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);
        }
    }
示例#3
0
    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);
        }
    }
示例#4
0
        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;
                        }
                    }
                }
            }
        }