public override void Press() { base.Press(); if (sceneLoader && sceneName != "") { sceneLoader.LoadNewScene(sceneName); } }
private void SaveName() { saveData.ReplaceName(playerData.Name, playerName); //save the player name in player prefs saveLoadPlayerName.SavePlayerName(playerName); //save the name in playerName script playerData.Name = playerName; sceneLoader.LoadNewScene("MainMenu"); }
public IEnumerator FadeToScene(string sceneName = "MainMenu") { if (!fadingToScene) { fadingToScene = true; yield return(new WaitForSeconds(.5f)); yield return(StartCoroutine(fadeImage.FadeTo(0, 1, 1f))); if (sceneLoader == null) { sceneLoader = GetComponent <SceneLoader>(); } sceneLoader.LoadNewScene(sceneName); } }
public override void Press() { base.Press(); sceneLoader.LoadNewScene("WelcomeScreen"); }
public void Restart() { gameSpeed.Reset(); sceneLoader.LoadNewScene("Game"); }