using UnityEngine.UI;
|
using UnityEngine;
|
using vnxbqy.UI;
|
using System.Collections.Generic;
|
|
public class ArenaRewardCell : ILBehaviour
|
{
|
|
Image rankImgBg;
|
Text rankNumText;
|
ItemCell m_ItemCell;
|
|
protected override void Awake()
|
{
|
rankImgBg = proxy.GetWidgtEx<Image>("RankNumBottom");
|
rankNumText = proxy.GetWidgtEx<Text>("RankNum");
|
m_ItemCell = proxy.GetWidgtEx<ItemCell>("ItemCell");
|
}
|
|
public void Display(int index)
|
{
|
rankImgBg.SetActiveIL(index < 3);
|
rankNumText.SetActiveIL(index >= 3);
|
rankNumText.text = (index + 1).ToString();
|
if (index < 3)
|
{
|
rankImgBg.SetSprite(index == 0 ? "Rank_First" : index == 1 ? "Rank_Second" : "Rank_Third");
|
}
|
else
|
{
|
if (ArenaModel.Instance.SelectRewardType == 1)
|
{
|
if (index == ArenaManager.dayAwardTypelist.Count - 1)
|
{
|
rankNumText.text = Language.Get("DemonJar13");
|
}
|
else
|
{
|
int first = ArenaManager.dayAwardTypelist[index - 1].num + 1;
|
int last = ArenaManager.dayAwardTypelist[index].num;
|
if (first == last)
|
{
|
rankNumText.text = first.ToString();
|
}
|
else
|
{
|
rankNumText.text = first.ToString() + "-" + last.ToString();
|
}
|
}
|
}
|
else
|
{
|
if (index == ArenaManager.seasonAwardTypelist.Count - 1)
|
{
|
rankNumText.text = Language.Get("DemonJar13");
|
}
|
else
|
{
|
int first = ArenaManager.seasonAwardTypelist[index - 1].num + 1;
|
int last = ArenaManager.seasonAwardTypelist[index].num;
|
if (first == last)
|
{
|
rankNumText.text = first.ToString();
|
}
|
else
|
{
|
rankNumText.text = first.ToString() + "-" + last.ToString();
|
}
|
}
|
}
|
}
|
|
int m_ItemID = 0;
|
int m_Count = 0;
|
if (ArenaModel.Instance.SelectRewardType == 1)
|
{
|
m_ItemID = ArenaManager.dayAwardTypelist[index].awardItems[0].itemId;
|
m_Count = ArenaManager.dayAwardTypelist[index].awardItems[0].itemCount;
|
m_ItemCell.Init(new ItemCellModel(m_ItemID, false, (ulong)m_Count));
|
m_ItemCell.button.AddListener(() => ItemTipUtility.Show(m_ItemID));
|
}
|
else
|
{
|
//赛季奖励
|
m_ItemID = ArenaManager.seasonAwardTypelist[index].awardItems[0].itemId;
|
m_Count = ArenaManager.seasonAwardTypelist[index].awardItems[0].itemCount;
|
m_ItemCell.Init(new ItemCellModel(m_ItemID, false, (ulong)m_Count));
|
m_ItemCell.button.AddListener(() => ItemTipUtility.Show(m_ItemID));
|
}
|
|
}
|
}
|