using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; public class NormalList : BaseList { public float rowSpacing; public float columnSpacing; public GameObject bLeft; public GameObject bRight; public TextMesh tPage; private int nPage=0; public void clickLeft() { nPage--; if (nPage < 0) { nPage = 0; } else { setPage(nPage); } } public void clickRight() { nPage++; if (nPage > getMaxPage()) { nPage = getMaxPage(); } else { setPage(nPage); } } public void setPage(int index) { nPage = index; int vIndex=0; for (int i=0;i(i+index*(Views.Count))) { Views[i].init((i + index * (Views.Count)),configs[(i + index * (Views.Count ))], vIndex); Views[i].baselist = this; Views[i].gameObject.SetActive(true); vIndex++; } else { Views[i].gameObject.SetActive(false); } } if(tPage!=null) { tPage.text = (nPage+1) + "/" + (getMaxPage()+1); } } public override void initList(List c) { base.initList(c); for (int i = 0; i < Views.Count; i++) { Views[i].transform.localPosition = new Vector3(((i) % Row) * rowSpacing, -((i) / Row) * columnSpacing, 0); } setPage(0); if (bLeft != null) { bLeft.AddComponent