Пример #1
0
        /// <summary>
        /// 座位信息变更回调
        /// </summary>
        /// <param name="obj"></param>
        private void OnSeatInfoChanged(TransferData data)
        {
            SeatEntity  seat             = data.GetValue <SeatEntity>("Seat");             //座位
            bool        isPlayer         = data.GetValue <bool>("IsPlayer");               //是否自己
            ROOM_STATUS roomStatus       = data.GetValue <ROOM_STATUS>("RoomStatus");      //房间状态
            RoomEntity  currentRoom      = data.GetValue <RoomEntity>("CurrentRoom");      //当前房间
            SeatEntity  BankerSeat       = data.GetValue <SeatEntity>("BankerSeat");       //庄家座位
            SeatEntity  ChooseBankerSeat = data.GetValue <SeatEntity>("ChooseBankerSeat"); //当前选庄座位

            if (isPlayer)
            {
                Debug.Log("自己座位准备状态:" + seat.seatStatus.ToString());
                m_ButtonReady.gameObject.SetActive(!seat.isReady && seat.seatStatus == SEAT_STATUS.IDLE);
                m_ButtonShare.gameObject.SetActive(roomStatus == ROOM_STATUS.IDLE);

                //设置开始按钮
                SetStartBtn(currentRoom, seat);

                if (!SystemProxy.Instance.IsInstallWeChat)
                {
                    m_ButtonShare.gameObject.SetActive(false);
                }
                //m_CancelAuto.gameObject.SetActive(seat.IsTrustee);


                //=================================设置下注按钮=================================================================================
                //                                                             是庄 自己未下注                                    不是庄 自己未下注 庄家已下注
                // m_Operater.NoticeJetton(roomStatus == ROOM_STATUS.POUR && (BankerSeat != null) && ((seat.IsBanker && seat.Pour <= 0) || ((seat.Pour <= 0) && (!seat.IsBanker) && BankerSeat.Pour > 0)), seat);
                m_Operater.NoticeJetton(roomStatus == ROOM_STATUS.GAME && seat.seatStatus == SEAT_STATUS.POUR, seat, currentRoom.baseScore);
                //RoomJuYouProxy

                //=================================设置选庄=================================================================================
                //选庄按钮
                // m_Operater.ChooseBanker(roomStatus == ROOM_STATUS.CHOOSEBANKER && currentRoom.ChooseBankerSeat != null && currentRoom.ChooseBankerSeat == seat);
            }
        }
 /// <summary>
 /// 刷新金币   由动画事件或初始刷新
 /// </summary>
 public void SetGold(SeatEntity seat)
 {
     m_TextGold.SafeSetText(seat.Gold.ToString());
 }
        ////头像点击
        //private void OnHeadClick()
        //{
        //    AudioEffectManager.Instance.Play("btnclick", Vector3.zero, false);

        //    if (DelegateDefine.Instance.OnHeadClick != null)
        //    {
        //        DelegateDefine.Instance.OnHeadClick(m_SeatPos);
        //    }
        //}



        public void SetUI(SeatEntity seat)
        {
            m_SeatIndex = seat.Index;
            SetPlayerInfo(seat);
        }
Пример #4
0
        /// <summary>
        /// 初始化房间
        /// </summary>
        /// <param name="prRoom"></param>
        public void InitRoom(JY_ROOM prRoom)
        {
            //RoomMaJiangProxy.Instance

            CurrentRoom = new RoomEntity()
            {
                currentLoop = prRoom.loop,
                maxLoop     = prRoom.maxLoop,
                roomId      = prRoom.roomId,
                //matchId = prRoom.matchId,
                roomStatus = prRoom.status,
                baseScore  = prRoom.baseScore,
            };

            //房间配置
            CurrentRoom.Config.Clear();
            for (int i = 0; i < prRoom.settingIdCount(); ++i)
            {
                cfg_settingEntity settingEntity = cfg_settingDBModel.Instance.Get(prRoom.getSettingId(i));
                if (settingEntity != null)
                {
                    CurrentRoom.Config.Add(settingEntity);
                }
            }

            //RoomPaiJiuProxy
            //创建座位
            CurrentRoom.SeatList = new List <SeatEntity>();
            for (int i = 0; i < prRoom.seatListCount(); i++)
            {
                JY_SEAT jySeat = prRoom.getSeatList(i);

                SeatEntity seat = new SeatEntity();

                //手牌
                for (int j = 0; j < jySeat.pokerListCount(); j++)
                {
                    seat.PokerList.Add(new Poker());
                }

                seat.SetSeat(jySeat);

                CurrentRoom.SeatList.Add(seat);

                if (seat.IsBanker)
                {
                    BankerSeat = seat;
                }
            }


            //(时间戳)
            if (prRoom.hasUnixtime())
            {
                CurrentRoom.Unixtime = prRoom.unixtime;
            }

            CalculateSeatIndex();

            PeopleCounting();
        }