Esempio n. 1
0
    private IEnumerator EndGame()
    {
        yield return(new WaitForSeconds(2f));

        HighScoreData highScoreData = SaveSystem.LoadHighScore();

        if (highScoreData == null)
        {
            highScoreData = new HighScoreData(currentScore, powerBar.ReturnAnimalName());
        }
        else
        {
            highScoreData.AddData(currentScore, powerBar.ReturnAnimalName());
        }
        SaveSystem.SaveHighScore(highScoreData);
        sceneLoader.LoadExpScene();
    }