public void OnAddItem(GameObject obj) { for (int i = 0; i < perAddItemCount; i++) { RankItemData data = new RankItemData(); data.rank = (addCount++) * 100; scrollViewManager.itemDatas.Add(data); } scrollViewManager.RefreshLoopScrollView(); }
void Start() { scrollViewManager = this.GetComponent<LoopScrollViewManager>(); scrollViewManager.itemDatas.Clear(); for (int i = 0; i < dataCount; i++) { RankItemData data = new RankItemData(); data.rank = i + 1; scrollViewManager.itemDatas.Add(data); } scrollViewManager.RefreshLoopScrollView(); // set button listener. UIEventListener.Get(btnAddItem).onClick = this.OnAddItem; UIEventListener.Get(btnRemoveItem).onClick = this.OnRemoveItem; if (btnRefresh != null) UIEventListener.Get(btnRefresh).onClick = this.OnRefreshWithTargetDataCount; }
void Start() { scrollViewManager = this.GetComponent <LoopScrollViewManager>(); scrollViewManager.itemDatas.Clear(); for (int i = 0; i < dataCount; i++) { RankItemData data = new RankItemData(); data.rank = i + 1; scrollViewManager.itemDatas.Add(data); } scrollViewManager.RefreshLoopScrollView(); // set button listener. UIEventListener.Get(btnAddItem).onClick = this.OnAddItem; UIEventListener.Get(btnRemoveItem).onClick = this.OnRemoveItem; if (btnRefresh != null) { UIEventListener.Get(btnRefresh).onClick = this.OnRefreshWithTargetDataCount; } }