예제 #1
0
 private IEnumerator OnPlayPressedRoutine()
 {
     TransitionFader.PlayTransition(startTransitionPrefab);
     LevelLoader.LoadNextLevel();
     GameMenu.Open();
     yield return(new WaitForSeconds(_playDelay));
 }
예제 #2
0
        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();
        }
예제 #3
0
        // 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;
        }
예제 #4
0
        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();
        }
예제 #6
0
        // 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;
        }
예제 #7
0
        /// <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();
        }
예제 #8
0
 public void OnNextLevelPressed()
 {
     // close the menu
     base.OnBackPressed();
     LevelLoader.LoadNextLevel();
 }
예제 #9
0
 public void OnNextLevelPressed()
 {
     base.OnBackPressed();
     LevelLoader.LoadNextLevel();
 }
예제 #10
0
 public void OnPlayPressed()
 {
     LevelLoader.LoadNextLevel();
 }