2026-06-08 08:55:10 +08:00
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using Kill.Managers;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
using UnityEngine.UI;
|
|
|
|
|
using Kill.Network;
|
|
|
|
|
|
|
|
|
|
namespace Kill.UI.Pages
|
|
|
|
|
{
|
|
|
|
|
public class RankItem : MonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
public Text nameText;
|
|
|
|
|
public Text countText;
|
|
|
|
|
public Image avatar;
|
|
|
|
|
public Text rankText;
|
2026-06-25 10:43:57 +08:00
|
|
|
public Sprite normalAvatar;
|
2026-07-13 14:17:12 +08:00
|
|
|
public Text country;
|
2026-06-08 08:55:10 +08:00
|
|
|
public void SetData(RankData data)
|
|
|
|
|
{
|
2026-06-25 10:43:57 +08:00
|
|
|
avatar.sprite=normalAvatar;
|
2026-06-08 08:55:10 +08:00
|
|
|
nameText.text = data.nickname;
|
|
|
|
|
countText.text = data.kill_count.ToString();
|
2026-07-13 14:17:12 +08:00
|
|
|
country.text=string.IsNullOrEmpty(data.country_code)?"--":LanguageManager.Instance.GetCountryStr(data.country_code);
|
2026-06-25 10:43:57 +08:00
|
|
|
if(!string.IsNullOrEmpty(data.avatar))
|
2026-06-08 08:55:10 +08:00
|
|
|
{
|
|
|
|
|
NetworkCtrl.Instance.LoadImageToUIImageAsync(data.avatar, avatar);
|
2026-06-25 10:43:57 +08:00
|
|
|
}
|
|
|
|
|
|
2026-06-08 08:55:10 +08:00
|
|
|
if(rankText!=null)
|
|
|
|
|
{
|
|
|
|
|
if(data.rank<=0)
|
|
|
|
|
{
|
|
|
|
|
rankText.text = "--";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
rankText.text = data.rank.ToString();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|