// When player collides with the warp this is called public void DoWarp() { GameManager.Instance.PlaySound("Warp"); // If this warp is the last one - mark the game as completed if (tag == "GameClearWarp") { SaveLoadManager.data.gameClear = true; SaveLoadManager.SaveCurrentData(); } if (levelName.Length > 0) { NewSceneManager.GotoScene(levelName, fadeOutTime, fadeInTime); return; } if (levelNumber >= 0) { NewSceneManager.GotoScene(levelNumber, fadeOutTime, fadeInTime); return; } NewSceneManager.NextScene(fadeOutTime, fadeInTime); return; }
void Update() { // On the first update in the sInit go to the appropriate scene. This ensures that // SoundManager and all other objects have their Start method executed if (NewSceneManager.SceneIndex == 0) { // Go to the main menu NewSceneManager.NextScene(0.0f, 4.0f); } // DEBUG/TEST CODE (BUT ALSO UNSKIPPABLE CREDITS LUL): if (!debugMode || NewSceneManager.SceneName == "sCredits") { return; } // Go to the next scene if (Input.GetKeyDown(KeyCode.PageUp)) { NewSceneManager.NextScene(); } // Go to the previous scene if (Input.GetKeyDown(KeyCode.PageDown)) { NewSceneManager.PrevScene(); } // Toggle player invincibility if (Input.GetKeyDown(KeyCode.I)) { playerIsInvincible = !playerIsInvincible; if (playerIsInvincible) { soundManager.PlaySound("Item"); } } }
public void NextScene() { NewSceneManager.NextScene(1.0f, 1.5f); }
void Transition() { NewSceneManager.NextScene(4.0f, 1.0f); }