Beispiel #1
0
    private void OnEnable()
    {
        GameDataManager dataManager = GameManager.Instance.GameDataManager;

        extraScore.text = "0";

        timeEnabled       = Time.unscaledTime;
        timeLeft          = HuntingLevelController.Instance.GetLevelTimeLeft() / 1000; // divide by 1000 to get sec
        timeLeftText.text = FormatAsClockTime(timeLeft);

        this.levelScore = dataManager.GameScore;
        gameScore.text  = this.levelScore.ToString();
        dataManager.AddGameScore(timeLeft); // add time left in seconds as points to game score
    }
Beispiel #2
0
 /// <summary>
 /// Saves data to be retrieved when switching scenes
 /// </summary>
 private void SaveScore()
 {
     dataManager.AddGameScore(levelScore);
 }