Example #1
0
    private void EndGaming(MessageXieYi xieyi)
    {
        Debug.Log("结束游戏");
        CurrentPlayType = FramePlayType.游戏未开始;
        frameIndex      = 0;
        reConnectIndex  = 0;//游戏结束的时候未完成复现,则清除重连记录帧
        CameraManager.instance.SetCameraEnable(false);
        CameraManager.instance.SetCameraFollow(transform);
        foreach (var item in memberGroup)
        {
            item.Value.Init(item.Key);
        }
        GameRunUI.Close();
        TeamType winTeam = (TeamType)int.Parse(SerializeHelper.ConvertToString(xieyi.MessageContent));

        RoomUI.Show();
        GameOverUI.Show(winTeam);
    }
Example #2
0
 public void Update()
 {
     if (serverEvent.Count > 0)
     {
         MessageXieYi xieyi = serverEvent.Dequeue();
         if ((MessageConvention)xieyi.XieYiFirstFlag == MessageConvention.createRoom ||
             (MessageConvention)xieyi.XieYiFirstFlag == MessageConvention.joinRoom)
         {
             JoinRoom joinInfo = new JoinRoom();
             joinInfo = SerializeHelper.Deserialize <JoinRoom>(xieyi.MessageContent);
             ErrorType error = joinInfo.error;
             if (error != ErrorType.none)
             {
                 UIManager.instance.ShowAlertTip("加入房间失败" + error);
             }
             else
             {
                 //GameManager.GetRoomInfo();
             }
         }
         if ((MessageConvention)xieyi.XieYiFirstFlag == MessageConvention.getRoomInfo)
         {
             RoomUI.Show();
             CreateRoomUI.Close();
         }
         if ((MessageConvention)xieyi.XieYiFirstFlag == MessageConvention.updateRoom)
         {
             ErrorType error = ClassGroup.CheckIsError(xieyi);
             if (error != ErrorType.none)
             {
                 UIManager.instance.ShowAlertTip("更新房间失败:" + error);
             }
             else
             {
                 UIManager.instance.ShowAlertTip("更新房间成功");
             }
             Close();
         }
     }
 }