public void Init(GameObject itemObject, List <object> data, GameObject previousPageBtn, GameObject nextPageBtn, IPagerItemCallback callback) { if (init) { throw new UnityException("PagerLayout can only be initiated once!"); } this.itemObject = itemObject; prevBtn = previousPageBtn; nextBtn = nextPageBtn; this.callback = callback; items = new List <PagerItem>(); LayoutElement referenceItem = itemObject.GetComponent <LayoutElement>(); cellMinSize = new Vector2(referenceItem.minWidth, referenceItem.minHeight); init = true; UpdateDataSet(data); }
public void Prepare(int layoutCellIndex, IPagerItemCallback callback) { this.layoutCellIndex = layoutCellIndex; this.callback = callback; }