コード例 #1
0
 /// <summary>
 /// 打开结束界面
 /// </summary>
 private void OpenResultView()
 {
     if (m_GuPaiJiuResult == null)
     {
         return;
     }
     UIViewUtil.Instance.LoadWindowAsync(UIWindowType.GuPaiJiuResult, (GameObject go) =>
     {
         m_UIGuPaiJiuResultView = go.GetComponent <UIGuPaiJiuResultView>();
         m_UIGuPaiJiuResultView.SetUI(m_GuPaiJiuResult);
         m_GuPaiJiuResult = null;
     });
 }
コード例 #2
0
    /// <summary>
    /// 服务器广播游戏结束
    /// </summary>
    private void OnServerBroadcastGameOver(byte[] obj)
    {
        GP_ROOM_GAMEOVER proto = GP_ROOM_GAMEOVER.decode(obj);

        if (!proto.hasRoom())
        {
            ExitGame();
            return;
        }
        UIViewUtil.Instance.LoadWindowAsync(UIWindowType.GuPaiJiuResult, (GameObject go) =>
        {
            m_UIGuPaiJiuResultView = go.GetComponent <UIGuPaiJiuResultView>();
            m_UIGuPaiJiuResultView.SetUI(proto);
            m_GuPaiJiuResult = null;
        });
    }
コード例 #3
0
    /// <summary>
    /// 解散房间的时候结算
    /// </summary>
    /// <param name="proto"></param>
    public void SetUI(GP_ROOM_TOTALSETTLE proto)
    {
        seatList = new List <SeatEntity>();
        for (int i = 0; i < proto.room.seatListCount(); i++)
        {
            GP_SEAT op_seat = proto.room.getSeatList(i);
            if (op_seat.playerId == 0)
            {
                continue;
            }
            SeatEntity seat = new SeatEntity();
            seat.PlayerId  = op_seat.playerId; //玩家ID
            seat.Nickname  = op_seat.nickname; //玩家名字
            seat.Avatar    = op_seat.avatar;   //玩家头像
            seat.Gender    = op_seat.gender;   //玩家性别
            seat.Gold      = op_seat.gold;     //底分
            seat.Pos       = op_seat.pos;      //座位位置
            seat.pokerList = new List <Poker>();
            for (int j = 0; j < op_seat.maxPokerListCount(); j++)
            {
                GP_POKER op_Poker = op_seat.getMaxPokerList(i);
                seat.pokerList.Add(new Poker()
                {
                    Index = op_Poker.index, //索引
                    Type  = op_Poker.type,  //花色
                    Size  = op_Poker.size,  //大小
                });
            }
            seatList.Add(seat);
        }
        SeatSort(seatList);
#if IS_CHUANTONGPAIJIU
        LoadRanking(seatList);
#else
        SetResult(seatList);
#endif
    }
コード例 #4
0
    /// <summary>
    /// 服务器广播解散成功结算
    /// </summary>
    /// <param name = "obj" ></ param >
    private void OnServerReturnResult(byte[] obj)
    {
        GP_ROOM_TOTALSETTLE proto = GP_ROOM_TOTALSETTLE.decode(obj);

        m_GuPaiJiuResult = proto;
    }