59 lines
1.7 KiB
C#
59 lines
1.7 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
using GCGame.Table;
|
|
|
|
public class AdvanceRankItem : UIItemSelect {
|
|
|
|
public class AdvanceRankItemData
|
|
{
|
|
public int advanceType; // 进阶类型
|
|
public int rank;
|
|
public string name;
|
|
public int star; // 星级
|
|
public int level; // 阶级
|
|
public int combat; // 战斗力
|
|
}
|
|
|
|
public Image specialRank;
|
|
public UIImgText normalRank;
|
|
public Image bg;
|
|
|
|
public Sprite[] specialSprite = new Sprite[3];
|
|
public Sprite[] specialBGSprite = new Sprite[3];
|
|
public Sprite nomalBGSprite;
|
|
public Text playerName;
|
|
public Text rankInfo;
|
|
|
|
public override void Show(Hashtable hash)
|
|
{
|
|
AdvanceRankItemData data = hash["InitObj"] as AdvanceRankItemData;
|
|
if(data != null)
|
|
{
|
|
specialRank.gameObject.SetActive(false);
|
|
normalRank.gameObject.SetActive(false);
|
|
|
|
if(data.rank > 0 && data.rank <= 3)
|
|
{
|
|
specialRank.gameObject.SetActive(true);
|
|
specialRank.sprite = specialSprite[data.rank - 1];
|
|
|
|
bg.sprite = specialBGSprite[data.rank - 1];
|
|
}
|
|
else if(data.rank > 0)
|
|
{
|
|
normalRank.gameObject.SetActive(true);
|
|
normalRank.text = data.rank.ToString();
|
|
|
|
bg.sprite = nomalBGSprite;
|
|
}
|
|
|
|
playerName.text = data.name;
|
|
|
|
int strID = 62921 + data.advanceType;
|
|
rankInfo.text = StrDictionary.GetClientDictionaryString("#{"+ strID.ToString() + "}", data.combat);
|
|
}
|
|
}
|
|
}
|