예제 #1
0
        private void setUserList(List <Score> scores)
        {
            List <ListItemBase <Score> > listItems = new List <ListItemBase <Score> >();

            foreach (Score score in scores)
            {
                ScoreListItem item = new ScoreListItem(score);
                listItems.Add(item);
            }
            tableListUI.loadAllItem <Score>(listItems);
        }
예제 #2
0
        private string getSpriteName(bool isSingular)
        {
            switch (MySession.Role)
            {
            case Login.RoleType.adminCheckbox:
                return(UserListItem.getSpriteName(isSingular));

            case Login.RoleType.instructorCheckbox:
                return(ScoreListItem.getSpriteName(isSingular));

            case Login.RoleType.studentCheckbox:
                return(ScoreListItem.getSpriteName(isSingular));
            }
            return(null);
        }
    void DisplayScoreList()
    {
        scores = Score.LoadScores();
        scores = Score.LoadScores();

        for (int i = 0; i < scores.Count; i++)
        {
            GameObject    newItem        = Instantiate(ListItemPrefab) as GameObject;
            ScoreListItem itemController = newItem.GetComponent <ScoreListItem>();
            itemController.Rank.text     = (i + 1).ToString();
            itemController.Score.text    = scores[i].score.ToString();
            itemController.Time.text     = scores[i].elapsedTime + "s";
            itemController.Size.text     = (scores[i].size.x + " x " + scores[i].size.z).ToString();
            itemController.Date.text     = scores[i].date.ToString();
            newItem.transform.parent     = ContentPanel.transform;
            newItem.transform.localScale = Vector3.one;
        }
    }