public EnhancedScrollerCellView GetCellView(EnhancedScroller scroller, int dataIndex, int cellIndex) { CellView cv = (CellView)scroller.GetCellView(cellView); cv.SetData(mDataLst[dataIndex], dataIndex); return(cv); }
// UI 处理 public void OnBtnItem(CellView cv, Data data) { sclRoot.SetActive(false); backBtn.SetActive(true); SceneManager.LoadScene(data.name); }
void Start() { GameObject.DontDestroyOnLoad(canvasRoot); OnBtnShowScroller(); scroller.Delegate = this; scroller.cellViewInstantiated = (scl, cv) => { CellView mycv = (CellView)cv; mycv.gameObject.SetActive(true); mycv.onClickFn = OnBtnItem; }; InitData(); }