using UnityEngine;
|
|
public class HeroDebutRankAwardCell : CellView
|
{
|
[SerializeField] ImageEx imgRank;
|
[SerializeField] TextEx txtRank;
|
[SerializeField] ItemCell[] itemCells;
|
public void Display(int rankA, int templateID)
|
{
|
var config = ActBillboardAwardConfig.GetConfig(templateID, rankA);
|
if (config == null) return;
|
|
|
if (rankA <= 3)
|
{
|
imgRank.SetActive(true);
|
txtRank.SetActive(false);
|
imgRank.SetSprite(StringUtility.Concat("Rank", rankA.ToString()));
|
txtRank.text = rankA.ToString();
|
}
|
else
|
{
|
imgRank.SetActive(false);
|
txtRank.SetActive(true);
|
txtRank.text = Language.Get("Arena15", rankA, config.RankB);
|
}
|
|
int[][] rewardArr = config.AwardItemList;
|
for (int i = 0; i < itemCells.Length; i++)
|
{
|
var itemCell = itemCells[i];
|
if (!rewardArr.IsNullOrEmpty() && i < rewardArr.Length)
|
{
|
int itemCellIndex = i;
|
itemCell.SetActive(true);
|
itemCell.Init(new ItemCellModel(rewardArr[i][0], true, rewardArr[i][1]));
|
itemCell.button.SetListener(() => ItemTipUtility.Show(rewardArr[itemCellIndex][0], true));
|
}
|
else
|
{
|
itemCell.SetActive(false);
|
}
|
}
|
}
|
}
|