using UnityEngine;
|
|
public class HeroCardLineCell : CellView
|
{
|
[SerializeField] HeroCardCell[] cardList;
|
|
//生效和未生效共用 heroSortList,activeCount 生效数量, index大于10000 未生效
|
public void Display(int index, int activeCount)
|
{
|
if (index < 10000)
|
{
|
//生效
|
for (int i = 0; i < cardList.Length; i++)
|
{
|
if (i + index < activeCount)
|
{
|
cardList[i].SetActive(true);
|
cardList[i].Display(index + i);
|
}
|
else
|
{
|
cardList[i].SetActive(false);
|
}
|
}
|
}
|
else
|
{
|
//未生效
|
index = index - 10000;
|
|
for (int i = 0; i < cardList.Length; i++)
|
{
|
if (i + index < HeroUIManager.Instance.heroSortList.Count)
|
{
|
cardList[i].SetActive(true);
|
cardList[i].Display(index + i);
|
}
|
else
|
{
|
cardList[i].SetActive(false);
|
}
|
}
|
}
|
}
|
}
|