Exemplo n.º 1
0
 /// <summary>
 /// 注册网络事件,也就是当接收到服务器push数据的时候,会触发action
 /// </summary>
 /// <param name="eventName">事件名称</param>
 /// <param name="action">触发的函数</param>
 public void on(Action <Message> action)
 {
     if (null != eventManager)
     {
         eventManager.AddOnEvent(action);
     }
     // eventManager.AddOnEvent(eventName, action);
 }
        public void on(string eventName, Action <bool, JsonObject> action)
        {
            if (!inited)
            {
                action(false, null);
                return;
            }

            eventManager.AddOnEvent(eventName, (obj) => { action(true, obj); });
        }
Exemplo n.º 3
0
 public void on(string eventName, Action <JsonObject> action)
 {
     eventManager.AddOnEvent(eventName, action);
 }
Exemplo n.º 4
0
 public void on(string eventName, Action <JSONNode> action)
 {
     eventManager.AddOnEvent(eventName, action);
 }
Exemplo n.º 5
0
 public void ListenTo(string eventName, Action <Message> action)
 {
     _eventManager.AddOnEvent(eventName, action);
 }