public static void OnGameOver() { if (self == null) { return; } self.canvas.SetActive(true); self.GetComponent <AudioSource>().Play(); self.textField.text = "You got a score of " + CoinCounter.GetCoins() + " and took " + TimerController.GetTime() + " Minutes!"; }
void OnTriggerEnter2D(Collider2D col) { if (col.tag != "Player") { return; } time = TimerController.GetTimeRaw(); coins = CoinCounter.GetCoins(); health = PlayerController.GetHealth(); SceneManager.sceneLoaded += OnSceneLoaded; SceneManager.LoadScene(levelName); }