1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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);
                }
            }
        }
    }
}