/// <summary> /// Update item data. /// </summary> /// <param name="data"></param> /// <param name="itemIndex"></param> internal void UpdateItemData(object data, int itemIndex) { currentSize = Vector2.zero; ItemIndex = itemIndex; InfiniteScrollItem.UpdateItemData(data); OnUpdateItemData(data); }
private void CreateViews() { ObjectContainer objectContainer = (!SafeLayout.IsTablet) ? this.phonePool : this.tabletPool; int num = Mathf.RoundToInt(((RectTransform)base.transform).rect.height / (float)this.height) + this.topPreloadRows + this.bottomPreloadRows; this._views = new InfiniteScrollItem[num]; for (int i = 0; i < num; i++) { InfiniteScrollItem entity = objectContainer.GetEntity <InfiniteScrollItem>(this._content); entity.name = i + string.Empty; entity.Row = -1; entity.transform.localScale = Vector3.one; entity.transform.localPosition = Vector3.zero; RectTransform component = entity.GetComponent <RectTransform>(); component.pivot = new Vector2(0.5f, 1f); component.anchorMin = new Vector2(0f, 1f); component.anchorMax = new Vector2(1f, 1f); component.offsetMax = new Vector2(0f, 0f); component.offsetMin = new Vector2(0f, (float)(-(float)this.height)); this._views[i] = entity; } this._rects = new RectTransform[this._views.Length]; for (int j = 0; j < this._views.Length; j++) { this._rects[j] = this._views[j].gameObject.GetComponent <RectTransform>(); } }
/// <summary> /// Hide /// </summary> internal void Hide() { ItemIndex = -1; InfiniteScrollItem.Hide(); OnHide(); }