コード例 #1
0
        public static LuaMessage CreateLuaMessage(int messageiD, object body = null)
        {
            LuaMessage luaMessage = pool.New();

            luaMessage.messageID = messageiD;
            luaMessage.body      = body;

            return(luaMessage);
        }
コード例 #2
0
 private void Send(LuaMessage msg)
 {
     RebuilddictObservers();
     if (dictObservers.ContainsKey(msg.messageID))
     {
         var observers = dictObservers[msg.messageID];
         foreach (var observer in observers)
         {
             if (observer.vaild)
             {
                 observer.callback(msg);
             }
         }
         msg.Realse();
     }
 }
コード例 #3
0
        public void Send(int messageID, object body)
        {
            LuaMessage msg = LuaMessage.CreateLuaMessage(messageID, body);

            Send(msg);
        }