// Use this for initialization void Start() { float time = float.PositiveInfinity; switch (difficulty) { case Difficulty.EASY: time = PlayerPrefs.GetFloat("easyscore", float.PositiveInfinity); break; case Difficulty.MEDIUM: time = PlayerPrefs.GetFloat("mediumscore", float.PositiveInfinity); break; case Difficulty.HARD: time = PlayerPrefs.GetFloat("hardscore", float.PositiveInfinity); Debug.Log(time); break; } if (time > 90000) { GetComponent <Text>().text = "-"; } else { GetComponent <Text>().text = TimeScore.toString(time); } }
// increment timer void CountTime() { gameTime += Time.deltaTime; time.text = TimeScore.toString(gameTime); }