public void OnClick(int i)
        {
            switch (i)
            {
            case 1:
                if (uiInputFieldController.GetName().Length > 0)
                {
                    var player = new Score.HighScore(pointsTracker.playerScore.CurrentScore,
                                                     uiInputFieldController.GetName());
                    scorePointSerializerController.AddPlayerToLadder(player);

                        #if UNITY_EDITOR
                    scorePointSerializerController.SaveHighScore(ScorePointSerializerController.PATH);
                        #else
                    scorePointSerializerController.SaveHighScore(ScorePointSerializerController.BIN_PATH);
                        #endif
                }

                SceneManager.LoadScene("GameMenu", LoadSceneMode.Single);
                break;
            }
        }
 /// <summary>
 /// Adds the player's score with name to the current loaded ladder.
 /// </summary>
 /// <param name="player"></param>
 public void AddPlayerToLadder(HighScore player)
 {
     highScoreLadder.AddHighScore(player);
 }
Beispiel #3
0
 /// <summary>
 /// Adds score and player name to ladder
 /// </summary>
 /// <param name="player"></param>
 public void AddHighScore(HighScore player)
 {
     highScores.Add(player);
 }