Exemplo n.º 1
0
    private void SetScoreValue()
    {
        String scoreName = SceneManager.GetActiveScene().name + "HighScore";

        if (scoreLvL < PlayerPrefs.GetFloat(scoreName, float.MaxValue))
        {
            PlayerPrefs.SetFloat(scoreName, scoreLvL);
            highScoreLvlUI.text = GameUtil.ConvertScore(scoreLvL);
            animBestScore.SetTrigger("best-score-alert");
        }
        else
        {
            float loadHighScore = PlayerPrefs.GetFloat(scoreName);
            highScoreLvlUI.text = GameUtil.ConvertScore(loadHighScore);
        }

        scoreLvlUI.text = GameUtil.ConvertScore(scoreLvL);
    }