Example #1
0
        public void Execute()
        {
            Debug.Log("执行结算命令");
            RoomMaJiangProxy.Instance.Settle(m_Settle);
            RoomMaJiangProxy.Instance.SetCountDown(0);

            if (MaJiangSceneCtrl.Instance != null)
            {
                bool isLiuJu = true;
                List <SeatEntity> lstWinerSeat = new List <SeatEntity>();
                //摊牌
                for (int i = 0; i < RoomMaJiangProxy.Instance.CurrentRoom.SeatList.Count; ++i)
                {
                    SeatEntity seat = RoomMaJiangProxy.Instance.CurrentRoom.SeatList[i];
                    if (seat.isWiner)
                    {
                        lstWinerSeat.Add(seat);
                    }
                }

                MaJiangSceneCtrl.Instance.Settle(lstWinerSeat);
            }
        }
        /// <summary>
        /// 当座位支对时
        /// </summary>
        /// <param name="obj"></param>
        private void OnSeatZhiDui(TransferData data)
        {
            SeatEntity seat = data.GetValue <SeatEntity>("Seat");

            PlayUIAnimation(seat.Index, UIAnimationType.UIAnimation_ZhiDui);
        }
Example #3
0
        public void Settle(List <SeatEntity> seats, int playerSeatPos, int currentLoop, int maxLoop,
                           List <Poker> prob, int matchId, Poker luckPoker, bool isQuan, bool isOver, int roomId, string huTaiCount, bool isFeng)
        {
            m_TxtGameLoop.SafeSetText(string.Format("游戏局数:{0}/{1}", currentLoop.ToString(), maxLoop.ToString()));
            m_TxtRoomId.SafeSetText("房间Id:" + roomId.ToString());

            bool isZimo    = true;
            int  bankerPos = 0;

            for (int i = 0; i < seats.Count; ++i)
            {
                if (seats[i].isLoser)
                {
                    isZimo = false;
                }
                if (seats[i].IsBanker)
                {
                    bankerPos = seats[i].Pos;
                }
            }

            if (!string.IsNullOrEmpty(huTaiCount))
            {
                m_TextTaiSetting.SafeSetText("胡台数:" + huTaiCount);
            }

            for (int i = 0; i < m_Cache.Count; ++i)
            {
                m_Cache[i].gameObject.SetActive(false);
            }

            UIViewManager.Instance.LoadItemAsync("UIItemHuInfo", (GameObject prefab) =>
            {
                for (int i = 0; i < seats.Count; ++i)
                {
                    SeatEntity seat           = seats[i];
                    UIItemSettleSeatInfo info = null;
                    if (i < m_Cache.Count)
                    {
                        info = m_Cache[i];
                        info.gameObject.SetActive(true);
                    }
                    else
                    {
                        GameObject go = Instantiate(prefab);
                        go.SetParent(m_HuInfoContainer);
                        info = go.GetComponent <UIItemSettleSeatInfo>();
                        m_Cache.Add(info);
                    }
                    info.SetUI(seat.Pos, seat.Pos == playerSeatPos, seat.Avatar, seat.Nickname, seat.Gold, seat.Settle,
                               seat.IsBanker, seat.PokerList, seat.HitPoker, seat.UsedPokerList, seat.SettleInfo, seat.HuScoreDetail,
                               seat.isWiner, prob, seat.ProbMulti, seat.isLoser, isZimo, seat.UniversalList, seat.TotalHuScore,
                               luckPoker, seat.IsTing, seat.HoldPoker, bankerPos, isFeng, seat.DeskTopPoker, seat.Direction);
                }
            });


            if (RoomMaJiangProxy.Instance.CurrentRoom.isReplay)
            {
                m_Page1.SetActive(false);
                m_Page2.SetActive(false);
                m_Page3.SetActive(true);
            }
            else
            {
                m_Page1.SetActive(!isOver);
                m_Page2.SetActive(isOver);
                m_Page3.SetActive(false);

                if (!isOver)
                {
                    m_isAutoClick = true;
                    m_fCountDown  = matchId > 0 ? AUTO_READY_COUNT_DOWN : AUTO_READY_COUNT_DOWN_COMMON;
                    m_fTimer      = Time.time;
                }
            }
        }