Example #1
0
    private static UnityEventImpl <T> GetEventOfType <T>()
    {
        if (!events.ContainsKey(typeof(T)))
        {
            events[typeof(T)] = new UnityEventImpl <T>();
        }

        return((UnityEventImpl <T>)events[typeof(T)]);
    }
Example #2
0
            UnityEventImpl <T> FindEventImpl <T>() where T : struct
            {
                var    keyType = typeof(T);
                object found;

                _dict.TryGetValue(keyType, out found);
                UnityEventImpl <T> eventImpl;

                if (found == null)
                {
                    eventImpl = new UnityEventImpl <T>();
                    _dict.Add(keyType, eventImpl);
                }
                else
                {
                    eventImpl = found as UnityEventImpl <T>;
                }

                return(eventImpl);
            }