コード例 #1
0
        public void DispatchEvent(YxEventType eventType, object param)
        {
            VoidObjectDelegate callFunc = GetEventListener(eventType);
            if (callFunc == null)
            {
                return;
            }

            if (!this.client.IsMainThread())
            {
                this.DispatchToMainThread(callFunc, param);
            }
            else
            {
                callFunc(param);
            }
        }
コード例 #2
0
 public void RemoveEventListener(YxEventType eventType)
 {
     if (this.callFuncEventTypeDict.ContainsKey(eventType))
     {
         this.callFuncEventTypeDict.Remove(eventType);
     }
 }
コード例 #3
0
 public void AddEventListener(YxEventType eventType, VoidObjectDelegate callFunc)
 {
     this.callFuncEventTypeDict[eventType] = callFunc;
 }
コード例 #4
0
 public VoidObjectDelegate GetEventListener(YxEventType eventType)
 {
     if (this.callFuncEventTypeDict.ContainsKey(eventType))
     {
         return this.callFuncEventTypeDict[eventType];
     }
     return null;
 }