/// <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 OnLevelPressed(int level) // odwoĊanie ustawione w edytorze { LevelLoader.instance.LoadLevel(level); Cursor.visible = false; GameMenu.Open(); }
public void OnPlayPressed() { LevelLoader.LoadLevel(currentMission?.SceneName); GameMenu.Open(); }