lcy
6 天以前 cffbf22341ba8fc5a60a37fe20a2b39ec3d8d7a3
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
using System.Collections.Generic;
using UnityEngine;
 
public class HeroReturnCallRateHeroCell : CellView
{
 
    [SerializeField] ItemCell[] itemCells;
    public void Display(int rowIndex, List<Item> dataList)
    {
        if (dataList == null) return;
 
        for (int i = 0; i < itemCells.Length; i++)
        {
            int dataIndex = rowIndex * HeroReturnCallRateHeroWin.rowCountMax + i;
 
            if (dataIndex < dataList.Count)
            {
                itemCells[i].SetActive(true);
                itemCells[i].Init(new ItemCellModel(dataList[dataIndex].id, true, dataList[dataIndex].countEx));
                itemCells[i].button.SetListener(() => ItemTipUtility.Show(dataList[dataIndex].id));
            }
            else
            {
                itemCells[i].SetActive(false);
            }
        }
    }
}