public void InitScroll() { this.scroll = base.GetComponent <ScrollRect>(); this.totalPages = this.scroll.content.childCount; if (this.OnCompleteEvent != null) { this.OnCompleteEvent.Invoke(this.CurrentPageClamped); } UI_InfiniteScroll component = base.GetComponent <UI_InfiniteScroll>(); component.Init(); this.itemOffset = component.ItemSize; }
public void InitScroll(int page = 0) { this.scroll = base.GetComponent <ScrollRect>(); this.totalPages = this.scroll.content.childCount; this.step = 1f / (float)(this.totalPages - 1); if (this.OnCompleteEvent != null) { this.OnCompleteEvent.Invoke(this.GetRelativePage(null)); } if (page > 0) { this.currentPage = page; this.scroll.horizontalNormalizedPosition = this.step * (float)page; } UI_InfiniteScroll component = base.GetComponent <UI_InfiniteScroll>(); component.Init(); }