private IEnumerator OnPlayPressedRoutine() { TransitionFader.PlayTransition(startTransitionPrefab); LevelLoader.LoadNextLevel(); GameMenu.Open(); yield return(new WaitForSeconds(_playDelay)); }
private IEnumerator OnPlayPressedRoutine() { TransitionFader.PlayTransition(startTransitionPrefab); LevelLoader.LoadNextLevel(); yield return(new WaitForSeconds(_playDelay)); // i dont like this solution. It adds .5 seconds delay on key press. GameMenu.Open(); }
// start the transition and play the first level private IEnumerator OnPlayPressedRoutine() { TransitionFader.PlayTransition(startTransitionPrefab, LevelLoader.CurrentSceneIndex); yield return(new WaitForSeconds(_playDelay)); LevelLoader.LoadNextLevel(); GameMenu.Open(); _active = false; }
private IEnumerator OnNextPressedRoutine() { TransitionFader.PlayTransition(_transitionPrefab, LevelLoader.CurrentSceneIndex); yield return(new WaitForSeconds(_playDelay)); LevelLoader.LoadNextLevel(); base.OnBackPressed(); _active = false; }
public void OnNextPressed() { base.OnBackPressed(); if (DataManager.Instance) { DataManager.Instance.Save(); } LevelLoader.LoadNextLevel(); }
// start the transition and play the first level private IEnumerator OnPlayPressedRoutine() { TransitionFader.PlayTransition(startTransitionPrefab, "In The Beginning..."); yield return(new WaitForSeconds(_playDelay)); if (PlayerController.Instance != null) { PlayerController.Instance.UnfreezePlayer(); } LevelLoader.LoadNextLevel(); GameMenu.Open(); _active = false; }
/// <summary> /// Routine that starts the transition between the Main menu and the game loading /// the first level on the scenes in build. /// </summary> /// <returns>An IEnumerator ready to be used as a Coroutine.</returns> IEnumerator OnPlayPressedRoutine() { // start the transition between scenes if (_startTransitionPrefab != null) { TransitionFader.CreateAndPlayTransition(_startTransitionPrefab); } // load the first level if (GameManager.Instance != null) { LevelLoader.LoadNextLevel(); } // wait a couple of seconds before hiding this menu and openning the game // menu yield return(new WaitForSeconds(_playDelay)); // open the game menu (the one with the button that allows the player // to pause the game) GameMenu.Open(); }
public void OnNextLevelPressed() { // close the menu base.OnBackPressed(); LevelLoader.LoadNextLevel(); }
public void OnNextLevelPressed() { base.OnBackPressed(); LevelLoader.LoadNextLevel(); }
public void OnPlayPressed() { LevelLoader.LoadNextLevel(); }