Beispiel #1
0
 // Update is called once per frame
 void Update()
 {
     //获取客户端消息本帧缓存的个数
     while (NetIO.GetSocketMessageCount() > 0)
     {
         SocketModel model = NetIO.GetMessage();
         if (model == null)
         {
             continue;
         }
         ;
         StartCoroutine("MsgRecvCallBack", model);
     }
 }
Beispiel #2
0
 /// <summary>
 /// 帧刷新
 /// </summary>
 void Update()
 {
     //获取客户端消息本帧缓存的个数
     while (NetIO.GetSocketMessageCount() > 0)
     {
         //获取最靠前的网络消息,本操作会将消息返回并删除
         SocketModel Model = NetIO.GetMessage();
         if (Model == null)
         {
             continue;
         }
         //开启协程,以达到异步执行消息回调
         StartCoroutine("MessageReceiveCallBack", Model);
     }
 }