// Token: 0x06000075 RID: 117 RVA: 0x00005F0C File Offset: 0x0000430C public EnhancedScrollerCellView GetCellView(EnhancedScroller scroller, int dataIndex, int cellIndex) { CellView cellView = scroller.GetCellView(this.cellViewPrefab) as CellView; cellView.name = "Cell" + dataIndex.ToString(); this.tempIndex = cellIndex * 2; if (this.tempIndex < 4) { this.setAppData(cellView, cellIndex); } else { this.setData(cellView, cellIndex); } return(cellView); }
// Token: 0x06000077 RID: 119 RVA: 0x00006288 File Offset: 0x00004688 private void setData(CellView cell, int index) { index = index * 2 - 4; cell.Image1.name = index + string.Empty; cell.Image1.transform.GetChild(0).gameObject.GetComponent <Image>().sprite = HomeScript.images[index]; cell.Image1.transform.GetChild(1).gameObject.name = "lock" + index; if (index >= 50) { if (PlayerPrefs.GetInt("Pic" + index) == 1) { cell.Image1.transform.GetChild(1).gameObject.SetActive(false); } else { cell.Image1.transform.GetChild(1).gameObject.SetActive(true); } } else { cell.Image1.transform.GetChild(1).gameObject.SetActive(false); } cell.Image1.GetComponent <Button>().onClick.RemoveAllListeners(); cell.Image1.GetComponent <Button>().onClick.AddListener(new UnityAction(this.script.ImageSelection)); index++; cell.Image2.name = index + string.Empty; cell.Image2.name = index + string.Empty; cell.Image2.transform.GetChild(0).gameObject.GetComponent <Image>().sprite = HomeScript.images[index]; cell.Image2.transform.GetChild(1).gameObject.name = "lock" + index; if (index >= 50) { if (PlayerPrefs.GetInt("Pic" + index) == 1) { cell.Image2.transform.GetChild(1).gameObject.SetActive(false); } else { cell.Image2.transform.GetChild(1).gameObject.SetActive(true); } } else { cell.Image2.transform.GetChild(1).gameObject.SetActive(false); } cell.Image2.GetComponent <Button>().onClick.RemoveAllListeners(); cell.Image2.GetComponent <Button>().onClick.AddListener(new UnityAction(this.script.ImageSelection)); }
/// <summary> /// Gets the cell to be displayed. You can have numerous cell types, allowing variety in your list. /// Some examples of this would be headers, footers, and other grouping cells. /// </summary> /// <param name="scroller">The scroller requesting the cell</param> /// <param name="dataIndex">The index of the data that the scroller is requesting</param> /// <param name="cellIndex">The index of the list. This will likely be different from the dataIndex if the scroller is looping</param> /// <returns>The cell for the scroller to use</returns> public EnhancedScrollerCellView GetCellView(EnhancedScroller scroller, int dataIndex, int cellIndex) { // first, we get a cell from the scroller by passing a prefab. // if the scroller finds one it can recycle it will do so, otherwise // it will create a new cell. CellView cellView = scroller.GetCellView(cellViewPrefab) as CellView; // set the name of the game object to the cell's data index. // this is optional, but it helps up debug the objects in // the scene hierarchy. cellView.name = "Cell " + dataIndex.ToString(); // in this example, we just pass the data to our cell's view which will update its UI cellView.SetData(_data[dataIndex]); // return the cell to the scroller return(cellView); }