using System.Collections;
|
using System.Collections.Generic;
|
using UnityEngine;
|
using UnityEngine.UI;
|
|
namespace vnxbqy.UI
|
{
|
public class FairyLeagueRankAwardCell : CellView
|
{
|
[SerializeField] Text m_Rank;
|
[SerializeField] ItemCell[] m_Items;
|
[SerializeField] Image m_Bottom;
|
FairyLeagueModel model
|
{
|
get { return ModelCenter.Instance.GetModel<FairyLeagueModel>(); }
|
}
|
|
public void Display(int worldLevel, int rank)
|
{
|
|
var gradeRank = rank % 4 == 0 ? 4 : rank % 4;
|
m_Rank.text = Language.Get("FairyLeageuNew_3", FairyModel.GetFairyGradeLabel(rank), gradeRank);
|
var items = model.GetFairyLeagueRankReward(worldLevel, rank);
|
for (int i = 0; i < m_Items.Length; i++)
|
{
|
m_Items[i].SetActive(i < items.Count);
|
if (i < items.Count)
|
{
|
var item = items[i];
|
var itemData = new ItemCellModel(item.id, true, (ulong)item.count);
|
m_Items[i].Init(itemData);
|
m_Items[i].button.SetListener(() =>
|
{
|
ItemTipUtility.Show(item.id);
|
});
|
}
|
}
|
|
m_Bottom.SetActive(rank % 2 == 0);
|
}
|
}
|
}
|
|