Пример #1
0
    /// <summary>
    /// 准备开始下一次
    /// </summary>
    public void NextGame()
    {
        //清空场景
        PaiJiu.Room Currentroom = RoomPaiJiuProxy.Instance.CurrentRoom;
        //1 将用过的牌放入桌子
        if (Currentroom.loopEnd)
        {
            MahJongManager_PaiJiu.Instance.ClearWall();
        }
        for (int i = 0; i < Currentroom.SeatList.Count; i++)
        {
            if (Currentroom.SeatList[i].PlayerId > 0)
            {
                //弃牌
                if (Currentroom.SeatList[i] == RoomPaiJiuProxy.Instance.PlayerSeat)
                {
                    m_UIScenePaiJiu3DView.ClearHandPoker();
                }

                SeatCtrl_PaiJiu seatCtrl = GetSeatCtrlBySeatPos(Currentroom.SeatList[i].Pos);
                seatCtrl.ClearHandPoker();

                //如果是一局结束 清空打过的牌
                if (Currentroom.loopEnd)
                {
                    seatCtrl.ClearDeskTopContainer();
                }

                //如果是一局结束 清空牌墙
            }
        }
    }
Пример #2
0
    /// <summary>
    /// 清空场景中全部Poker
    /// </summary>
    private void ClealAllScenePoker()
    {
        //清空场景
        PaiJiu.Room Currentroom = RoomPaiJiuProxy.Instance.CurrentRoom;
        //1 将用过的牌放入桌子
        MahJongManager_PaiJiu.Instance.ClearWall();
        for (int i = 0; i < Currentroom.SeatList.Count; i++)
        {
            if (Currentroom.SeatList[i].PlayerId > 0)
            {
                SeatCtrl_PaiJiu seatCtrl = GetSeatCtrlBySeatPos(Currentroom.SeatList[i].Pos);

                if (seatCtrl != null)
                {
                    //弃牌
                    if (Currentroom.SeatList[i] == RoomPaiJiuProxy.Instance.PlayerSeat)
                    {
                        m_UIScenePaiJiu3DView.ClearHandPoker();
                    }
                    else
                    {
                        //清空手牌
                        seatCtrl.ClearHandPoker();
                    }
                    //清空打过的牌
                    seatCtrl.ClearDeskTopContainer();
                }
            }
        }
    }
Пример #3
0
    /// <summary>
    /// 选庄时场景处理
    /// </summary>
    public void ChooseBanker()
    {
        //清空场景
        PaiJiu.Room Currentroom = RoomPaiJiuProxy.Instance.CurrentRoom;

        MahJongManager_PaiJiu.Instance.ClearWall();

        for (int i = 0; i < Currentroom.SeatList.Count; i++)
        {
            if (Currentroom.SeatList[i].PlayerId > 0)
            {
                SeatCtrl_PaiJiu seatCtrl = GetSeatCtrlBySeatPos(Currentroom.SeatList[i].Pos);
                seatCtrl.ClearHandPoker();
                seatCtrl.ClearDeskTopContainer();
            }
        }
    }
Пример #4
0
    /// <summary>
    ///  发牌
    /// </summary>
    /// <param name="room"></param>
    /// <param name="isPlayAnimation"></param>
    private void DrawPoker(PaiJiu.Room room, bool isPlayAnimation)
    {
        //===================摸牌=======================
        if (!isPlayAnimation)
        {
            for (int i = 0; i < room.SeatList.Count; i++)
            {
                PaiJiu.Seat seat = room.SeatList[i];
                //桌面上的牌
                for (int j = 0; j < seat.TablePokerList.Count; j++)
                {
                    AppDebug.Log(string.Format("重连房间座位{0}已出的牌{1}", seat.Pos, (seat.TablePokerList[j].type + "_" + seat.TablePokerList[j].size)));
                    MaJiangCtrl_PaiJiu majiang = MahJongManager_PaiJiu.Instance.DrawMaJiang(seat.Pos, seat.TablePokerList[j]);
                }

                //清空摸到手里的已出过的牌
                if (seat.TablePokerList.Count > 0)
                {
                    GetSeatCtrlBySeatPos(seat.Pos).ClearHandPoker();
                }
                //AppDebug.Log(string.Format("------------------------------------------------重连房间座位手牌长度{0}", seat.PokerList.Count));


                //手里的牌
                for (int j = 0; j < seat.PokerList.Count; ++j)
                {
                    //if (seat == RoomPaiJiuProxy.Instance.PlayerSeat) AppDebug.Log(string.Format("---PlayerSeat---------重连房间座位手牌{0}", seat.PokerList[j].type + "_" + seat.PokerList[j].size));
                    MaJiangCtrl_PaiJiu majiang = null;
                    majiang = MahJongManager_PaiJiu.Instance.DrawMaJiang(seat.Pos, seat.PokerList[j]);

                    //显示手牌
                    if (seat == RoomPaiJiuProxy.Instance.PlayerSeat)
                    {
                        m_UIScenePaiJiu3DView.DrawPoker(majiang);
                    }
                    else
                    {
                        GetSeatCtrlBySeatPos(seat.Pos).DrawPoker(majiang);
                    }
                    //DRB.MahJong.MaJiangSceneCtrl
                }
            }
#if IS_ZHANGJIAKOU
            // 如果有牌墙具体信息 则翻开牌墙
            if (room.pokerWall.Count > 0)
            {
                DrawMaJiangWall(room.pokerWall, false);
            }
#endif
        }
        else
        {
            //清空手牌
            for (int i = 0; i < room.SeatList.Count; i++)
            {
                SeatCtrl_PaiJiu seatCtrl = GetSeatCtrlBySeatPos(room.SeatList[i].Pos);
                if (seatCtrl != null)
                {
                    seatCtrl.ClearHandPoker();
                }
            }
            StartCoroutine(BeginAnimation(/*isReplay*/));
        }
    }