yyl
2025-07-18 cc074976c8644508d80abafbfa8de5d31146abdf
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
 
/// <summary>
/// 武将列表
/// </summary>
public class HeroListWin : UIBase
{
    [SerializeField] Button heroPackBtn;
    [SerializeField] Text heroPackText;
    [SerializeField] ScrollerController heroListScroller;
    [SerializeField] GameObject heroListEmpty;
    [SerializeField] List<Text> attrOnList; //上阵属性加成
    [SerializeField] GameObject attrOnTip;
    [SerializeField] Button attrOnTipBtn;
 
    [SerializeField] GameObject foldObject;
    [SerializeField] Button unFoldBtn; //展开按钮
    [SerializeField] List<Button> countryBtnList;
    [SerializeField] GameObject unFoldObject;
    [SerializeField] Button foldBtn; //收起按钮
    [SerializeField] List<Button> jobBtnList;   //全部,输出、肉盾、辅助、控制
    [SerializeField] Button changeHeroPosBtn; //布阵按钮
 
 
    private List<Image> countrySelectImgList;
    private List<Image> jobSelectImgList;
 
    /// </summary>
    protected override void InitComponent()
    {
 
    }
 
 
    protected override void OnPreOpen()
    {
        heroListScroller.OnRefreshCell += OnRefreshCell;
        HeroManager.Instance.SortHeroList();
        CreateScroller();
    }
 
    protected override void OnPreClose()
    {
        heroListScroller.OnRefreshCell -= OnRefreshCell;
    }
 
 
    public override void Refresh()
    {
 
    }
 
    void OnRefreshCell(ScrollerDataType type, CellView cell)
    {
        var _cell = cell as HeroCardLineCell;
        _cell.Display(cell.index);
    }
 
    void CreateScroller()
    {
        heroListScroller.Refresh();
        for (int i = 0; i < HeroManager.Instance.heroSortList.Count; i++)
        {
            if (i % 4 == 0)
            { 
                heroListScroller.AddCell(ScrollerDataType.Header, i);
            }
        }
        heroListScroller.Restart();
    }
 
 
    
}