using vnxbqy.UI;
|
using System;
|
using System.Collections.Generic;
|
using UnityEngine;
|
using UnityEngine.UI;
|
|
class TreasurePavilionObjsCell : ILBehaviour
|
{
|
List<Transform> cells = new List<Transform>();
|
|
protected override void Awake()
|
{
|
for (int i = 0; i < 5; i++)
|
{
|
cells.Add(proxy.GetWidgtEx<Transform>("TreasurePavilionCell" + i));
|
}
|
}
|
|
|
|
public void Display(int index, CellView cellView)
|
{
|
int selectTagIndex = cellView.info.Value.infoInt1;
|
//显示全部
|
if (selectTagIndex == 0)
|
{
|
var totalCnt = TreasurePavilionModel.Instance.GetGubaoList().Count;
|
for (int i = 0; i < 5; i++)
|
{
|
if ((index + i) < totalCnt)
|
{
|
cells[i].SetActiveIL(true);
|
var cell = cells[i].GetILBehaviour<TreasurePavilionCell>();
|
int gubaoID = TreasurePavilionModel.Instance.GetGubaoList()[index + i];
|
cell.Display(gubaoID, 0.8f);
|
}
|
else
|
{
|
cells[i].SetActiveIL(false);
|
}
|
}
|
}
|
//显示可升星的
|
else if (selectTagIndex == 2)
|
{
|
TreasurePavilionModel.Instance.TryGetUpgradeStarList(out var upgradeStarList);
|
var totalCnt = upgradeStarList.Count;
|
for (int i = 0; i < 5; i++)
|
{
|
if ((index + i) < totalCnt)
|
{
|
cells[i].SetActiveIL(true);
|
var cell = cells[i].GetILBehaviour<TreasurePavilionCell>();
|
int gubaoID = upgradeStarList[index + i];
|
cell.Display(gubaoID, 0.8f);
|
}
|
else
|
{
|
cells[i].SetActiveIL(false);
|
}
|
}
|
}
|
}
|
|
|
}
|