using System.Collections.Generic; using System.Linq; using UnityEngine; using UnityEngine.UI; //基金入口 public class BattlePassBaseWin : UIBase { [SerializeField] ScrollerController scroller; protected override void OnPreOpen() { scroller.OnRefreshCell += OnRefreshCell; CreateScroller(); } protected override void OnPreClose() { scroller.OnRefreshCell -= OnRefreshCell; } void CreateScroller() { scroller.Refresh(); foreach(var type in BattlePassManager.Instance.battlePassTypeSortList) { if (!FuncOpen.Instance.IsFuncOpen(BattlePassManager.Instance.typeToFuncIDDict[type])) { continue; } scroller.AddCell(ScrollerDataType.Header, type); } scroller.Restart(); } void OnRefreshCell(ScrollerDataType type, CellView cell) { var _cell = cell as BattlePassBaseCell; _cell.Display(cell.index); } }