Beispiel #1
0
    public override void SetInfo(object data)
    {
        _info = (PVPRankInfo)data;
        // 排名
        if (_info.Rank < _sprRank.Length)
        {
            _imgRank.gameObject.SetActive(true);
            _txtRank.gameObject.SetActive(false);
            _imgRank.sprite = _sprRank[_info.Rank - 1];
        }
        else
        {
            _imgRank.gameObject.SetActive(false);
            _txtRank.gameObject.SetActive(true);
            _txtRank.text = _info.Rank.ToString();
        }

        if (_info.Rank < _color.Length)
        {
            _txtName.color       = _color[_info.Rank - 1];
            _txtRank.color       = _color[_info.Rank - 1];
            _txtGuild.color      = _color[_info.Rank - 1];
            _txtFightScore.color = _color[_info.Rank - 1];
        }

        _imgIcon.sprite     = ResourceManager.Instance.GetPlayerIcon(_info.Icon);
        _txtName.text       = _info.Name;
        _txtLevel.text      = "Lv" + _info.Level;
        _txtGuild.text      = _info.GuildName;
        _txtFightScore.text = _info.FightScore.ToString();
    }
Beispiel #2
0
    private void OnMsgAthteclicRankList(byte[] buffer)
    {
        PAthleticsList ret = Net.Deserialize <PAthleticsList>(buffer);

        if (!Net.CheckErrorCode(ret.errorCode, eCommand.ATHTECLIC_RANK_LIST))
        {
            return;
        }

        // 对手
        PVPManager.Instance.RankList.Clear();
        foreach (var item in ret.athletics)
        {
            PVPRankInfo info = new PVPRankInfo();
            info.Deserialize(item);
            PVPManager.Instance.RankList.Add(info);
        }

        // 刷新ui
        UIManager.Instance.RefreshWindow <UIPVPRankView>();
    }