예제 #1
0
        public void UnregisterSignalForId <T>(Int64 id, Action <T> callback) where T : DataObject
        {
            Type type = typeof(T);

            if (m_signals.ContainsKey(type))
            {
                DataObjectSignal <T> action = m_signals[type] as DataObjectSignal <T>;
                action.UnregisterSignal(callback);
            }
        }
예제 #2
0
        public void RegisterSignalForId <T>(Int64 id, Action <T> callback) where T : DataObject
        {
            Type type = typeof(T);

            if (m_signals.ContainsKey(type))
            {
                DataObjectSignal <T> action = m_signals[type] as DataObjectSignal <T>;
                action.RegisterSignal(callback);
            }
            else
            {
                var newSignal = new DataObjectSignal <T>();
                newSignal.RegisterSignalForId(id, callback);
                m_signals.Add(type, newSignal as DataObjectSignal <DataObject>);
            }
        }