private IEnumerator LoadNextLevel() { // SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1); // Instead of loading the first scene, switching to loading a random scene starting the game over. SceneManager.LoadScene(sceneRandomizer.GetRandomSceneIndex()); yield return(null); levelCounter.text = levelCounterPrefix + sceneRandomizer.GetPlayedScenes(); coinMultiplier += coinMultiplierIncrease; PlaySound(startSound); GetPlayer(); ResetCollectiblesRemaining(GameObject.FindGameObjectsWithTag("Collectible").Length); illuminate.ResetFuel(); illuminate.SetDisabled(false); }
private void Update() { if (canStart && Input.anyKeyDown) { SceneManager.LoadScene(sceneRandomizer.GetRandomSceneIndex()); } }