示例#1
0
 private void SaveScore()
 {
     if (!string.IsNullOrEmpty(score.Name))
     {
         score.Round = roundNumber;
         score.Level = levelNumber;
         ScoreRepositoryAction scoreRepositoryAction = new ScoreRepositoryAction();
         scoreRepositoryAction.SaveNewScoor(score);
     }
 }
示例#2
0
    private void AddScoors()
    {
        ScoreRepositoryAction scoreRepositoryAction = new ScoreRepositoryAction();
        var scoreList = scoreRepositoryAction.GetScores();

        if (scoreList.Scores.Count > 0)
        {
            scoreList.Scores = scoreList.Scores.SortBy(s => s.Round);
            scoreList.Scores = scoreList.Scores.SortBy(s => s.Level);
            foreach (var score in scoreList.Scores)
            {
                var    text      = Instantiate(scoorPreFab);
                string scoreText = score.Name + " - Level: " + score.Level + " - Round: " + score.Round;
                text.GetComponent <Text>().text = scoreText;
                text.transform.parent           = hieghtScoors.transform;
                text.transform.localScale       = new Vector3(1, 1, 1);
            }
        }
    }