public int GetNumberOfCells(LoopScroller scroller) { if (m_Datas == null) { return(0); } return(m_Datas.Count); }
public virtual LoopScrollerCellView GetCellView(LoopScroller scroller, int dataIndex, int cellIndex) { TCellView cellView = scroller.GetCellView(m_ItemTemplate) as TCellView; cellView.dataIndex = dataIndex; cellView.name = "Cell " + dataIndex.ToString(); cellView.SetData(m_Datas[dataIndex]); if (!cellView.gameObject.activeSelf) { cellView.gameObject.SetActive(true); } return(cellView); }
public virtual float GetCellViewSize(LoopScroller scroller, int dataIndex) { return(m_ItemTemplate.PreferredWidth); }