少年修仙传客户端代码仓库
hch
3 天以前 50e53441950268933694eeb5aad36147bbe1014d
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
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);
            }
        }
    }
 
}