예제 #1
0
    public void EndGame()
    {
        //Set pause
        PauseGame();
        GameUIManager.Instance.GameOver(CoinsCount, Score);

        //save coins ad score
        DataHolder.AddCoinsCount(CoinsCount);
        if (score > DataHolder.GetMaxScore())
        {
            DataHolder.SetMaxScore((int)score);
        }
    }
예제 #2
0
    public void RestartGame()
    {
        //Set coins and score to zero
        DataHolder.AddCoinsCount(CoinsCount);
        coinsCount = 0;
        score      = 0f;

        Start();

        //Set initial values
        TimeManager.Instance.TimeCount = SettingsManager.Instance.startTimeCount;
        player.speed = SettingsManager.Instance.startPlayerSpeed;
        SectionManager.Instance.Restart();
    }