using vnxbqy.UI;
|
using System.Collections.Generic;
|
using UnityEngine.UI;
|
|
public class TTLBPBuyItemCell : ILBehaviour
|
{
|
List<ItemCell> items = new List<ItemCell>();
|
|
protected override void Awake()
|
{
|
for (int i = 0; i < 5; i++)
|
{
|
items.Add(proxy.GetWidgtEx<ItemCell>("itemCell" + i));
|
}
|
}
|
|
public void Display(int index)
|
{
|
for (int i = 0; i < items.Count; i++)
|
{
|
if (index + i < TTLBattlePassModel.Instance.buyItems.Count)
|
{
|
items[i].SetActiveIL(true);
|
int itemID = TTLBattlePassModel.Instance.buyItems[index + i].id;
|
items[i].Init(new ItemCellModel(itemID, false, (ulong)TTLBattlePassModel.Instance.buyItems[index + i].count));
|
items[i].button.SetListener(()=> {
|
ItemTipUtility.Show(itemID);
|
});
|
var lockImg = items[i].transform.Find("Image").GetComponent<Image>();
|
lockImg.SetActiveIL(TTLBattlePassModel.Instance.buyItems[index + i].bind == 1);
|
}
|
else
|
{
|
items[i].SetActiveIL(false);
|
}
|
}
|
}
|
|
}
|