//Will be called by the TableView when a cell's visibility changed public void TableViewCellVisibilityChanged(int row, bool isVisible) { //Debug.Log(string.Format("Row {0} visibility changed to {1}", row, isVisible)); if (isVisible) { HighScoreTableCell cell = (HighScoreTableCell)m_tableView.GetCellAtRow(row); cell.NotifyBecameVisible(); } }
//Will be called by the TableView when a cell needs to be created for display public TableViewCell GetCellForRowInTableView(TableView tableView, int row) { HighScoreTableCell cell = tableView.GetReusableCell(m_cellPrefab.reuseIdentifier) as HighScoreTableCell; if (cell == null) { cell = (HighScoreTableCell)GameObject.Instantiate(m_cellPrefab); cell.name = "highscore1" + (++m_numInstancesCreated).ToString(); } if (m_numInstancesCreated < m_numRows) { cell.SetPlayerName(highscores[m_numInstancesCreated].name); cell.SetPlayerScore(highscores[m_numInstancesCreated].score); } return(cell); }