示例#1
0
    public void LeaveRoom()
    {
        StopCarAnimation();

        transform.GetChild(2).gameObject.SetActive(false);
        transform.GetChild(1).gameObject.SetActive(false);
        transform.GetChild(2).gameObject.SetActive(false);
        transform.GetChild(2).GetChild(7).gameObject.SetActive(false);
        //progressImg.gameObject.SetActive(false);
        //HideCards(true);
        if (btn_Compare != null)
        {
            btn_Compare.gameObject.SetActive(false);
        }
        player    = null;
        isInit    = false;
        isPrepare = false;
        isFlod    = false;
        if (btn_HeadImg != null)
        {
            btn_HeadImg.onClick.RemoveAllListeners();
        }

        if (btn_Compare != null)
        {
            btn_Compare.onClick.RemoveAllListeners();
        }
    }
示例#2
0
    public void UpdateUIData(Game1PlayerRoomBaseInfoDto game1PlayerRoomBaseInfoDto, bool isCar)
    {
        if (player == null)
        {
            player = game1PlayerRoomBaseInfoDto;
            if (!isInit)
            {
                Init();
                isInit = true;
            }
            bool isPlayerCarAni = isCar;

            if (isPlayerCarAni)
            {
                //播放车进场动画
                if (player.autoId > 0)
                {
                    PlayCarAnimation(player.autoId);
                }
                else
                {
                    InitPlayerInfo();
                }
            }
            else
            {
                InitPlayerInfo();
            }
        }
    }
示例#3
0
        /// <summary>
        /// 有玩家进入房间
        /// </summary>
        /// <param name="dto"></param>
        public override void playerEnterRoom(Game1PlayerRoomBaseInfoDto dto)
        {
            Debug.Log("有玩家进入房间");
            if (!PlayerCache.roomPlayersInfoDic.ContainsKey(dto.uid))
            {
                PlayerCache.roomPlayersInfoDic.Add(dto.uid, dto);
                DebugUtils.DebugerExtension.Log("roomPlayersInfoDic加入success");
            }
            else
            {
                //error
                DebugUtils.DebugerExtension.Log("error");
                return;
            }


            int        clientSeat = GameTools.Instance.GetClentSeat(dto.postion, PlayerCache.currentRoomSelfServerSeat);
            GamePlayer uiMsg      = null;

            switch ((SeatType)clientSeat)
            {
            case SeatType.Bottom:
                //me
                uiMsg = MessageManager.GetInstance.GetUIDict <UISelfPlayer>();
                break;

            case SeatType.LeftTop:
                uiMsg = MessageManager.GetInstance.GetUIDict <UILeftTopPlayer>();
                break;

            case SeatType.LeftBottom:
                uiMsg = MessageManager.GetInstance.GetUIDict <UILeftBottomPlayer>();

                break;

            case SeatType.RightTop:
                uiMsg = MessageManager.GetInstance.GetUIDict <UIRightTopPlayer>();

                break;

            case SeatType.RightBottom:
                uiMsg = MessageManager.GetInstance.GetUIDict <UIRightBottomPlayer>();
                break;

            default:
                uiMsg = null;
                break;
            }
            if (uiMsg != null)
            {
                uiMsg.UpdateUIData(dto, true);
                PlayerCache.roomPlayerObjDic.Add(dto.uid, uiMsg);
                DebugUtils.DebugerExtension.Log("roomPlayerObjDic加入success");
                if (PlayerCache.currentRoomState == 1)
                {
                    if (dto.hasReady)
                    {
                        uiMsg.UpdateState(PlayerStatus.Prepare);
                        if (PlayerCache.playGamePlayer.ContainsKey(dto.postion))
                        {
                            PlayerCache.playGamePlayer.Remove(dto.postion);
                        }
                        PlayerCache.playGamePlayer.Add(dto.postion, dto.uid);
                        DebugUtils.DebugerExtension.Log("playGamePlayer加入success");
                    }
                }
            }
        }
示例#4
0
 /// <summary>
 /// 玩家进入房间
 /// </summary>
 public virtual void playerEnterRoom(Game1PlayerRoomBaseInfoDto dto)
 {
 }