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
    void Start()
    {
        allowedMoves            = Config.MovesAmount;
        Player.OnBlocksRemoved += OnPlayerMove;
        Score.SetGameConfig(Config);

        SetPlayerInput();
        SaveGame saveGame = HighscoreUtility.LoadHighscore();
    }