Example #1
0
 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();
        }
Example #3
0
        private IEnumerator PlayMissionRoutine(string sceneName)
        {
            TransitionFader.PlayTransition(_playTrasitionPrefab);
            LevelLoader.LoadLevel(sceneName);
            yield return(new WaitForSeconds(_playDelay));

            GameMenu.Open();
        }
Example #4
0
        IEnumerator OnCollectModePressedRoutine()
        {
            TransitionFader.PlayTransition(startTransitionPrefab);
            LevelLoader.LoadCollectModeLevel();
            yield return(new WaitForSeconds(_playDelay));

            GameMenu.Open();
        }
Example #5
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;
        }
Example #6
0
        public void OnPlayPressed()
        {
            if (GameManager.Instance != null)
            {
                GameManager.Instance.LoadNextLevel();
            }

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