Exemplo n.º 1
0
    private void OnPlayerMove(int blocksRemoved)
    {
        Score.SetScoreForRemovedBlocks(blocksRemoved);
        allowedMoves--;
        if (allowedMoves == 0)
        {
            Player.enabled = false;
            Score.HideScoring();

            SaveGame saveGame = HighscoreUtility.LoadHighscore();
            if (saveGame != null)
            {
                if (saveGame.Score < Score.Score)
                {
                    HighscoreUtility.SaveHighscore(new SaveGame()
                    {
                        Score = Score.Score
                    });
                }
            }
            else
            {
                HighscoreUtility.SaveHighscore(new SaveGame()
                {
                    Score = Score.Score
                });
            }


            View.SetFinalScore(Score.Score);
            View.SetGameViewVisibility(true);
        }
    }
Exemplo n.º 2
0
    private void ReturnToMenu()
    {
        if (IsNewHighscore())
        {
            HighscoreUtility.SaveHighscore(currentLevel);
        }

        UnityEngine.SceneManagement.SceneManager.LoadScene(0);
    }