Example #1
0
        protected override void CreateSubObjects(ListViewItem item, string columnName)
        {
            ListViewItem.ListViewSubItem subItem = item.SubItems [ColumnNames.IndexOf(columnName)];
            LeaderboardRow itemData = item.Tag as LeaderboardRow;

            if (columnName == TacoConfig.LeaderboardTournamentPlayerColumn)
            {
                GameObject            button = Instantiate(ItemLeaderboardButtonPrefab);
                LeaderboardItemButton leaderboardItemButton = button.GetComponent <LeaderboardItemButton> ();
                leaderboardItemButton.Setup(itemData.rank, itemData.picture, subItem.Text, ListView.DefaultItemFontSize);
                subItem.CustomControl = button.transform as RectTransform;
            }
        }
        private void createCustomObjects(ListViewItem item)
        {
            var subItem = item.SubItems [1];
            // int index = this.ListView.SelectedIndices[0];
            // var t = Items[index];


            LeaderboardRow itemData = item.Tag as LeaderboardRow;

            GameObject button = GameObject.Instantiate(ItemLeaderboardButtonPrefab) as GameObject;

            subItem.CustomControl = button.transform as RectTransform;

            LeaderboardItemButton leaderboardItemButton = button.GetComponent <LeaderboardItemButton> ();

            // TODO get avatar from user
            int avatar = UnityEngine.Random.Range(0, 7);

            leaderboardItemButton.Setup(itemData.rank, avatar);
        }