Example #1
0
        // The public variable for other classes to access the progress

        // Clearing the pause at the start
        public void Start()
        {
            staticSlider        = sliderObject;
            staticPercentage    = loadingPercentage;
            staticLoadingSlider = loadingSlider;

            animator = GetComponent <Animator>();
            PauseHandler.RemovePause(PauseId);
            loadLevel?.Stop();
            sliderObject.SetActive(false);
        }
Example #2
0
        public void ChangePause()
        {
            isPaused = !isPaused;

            // Turn the pause menu on or off depending on if the
            // game is paused or not
            pauseMenuUi.SetActive(isPaused);

            // Change the time scale also accordingly
            if (isPaused)
            {
                PauseHandler.Pause(pauseId);
            }
            else
            {
                PauseHandler.RemovePause(pauseId);
            }
        }
Example #3
0
 // Moving the scene to the main menu scene
 public void Menu()
 {
     SceneManager.LoadScene(LoadLevelManager.MainMenuRef);
     PauseHandler.RemovePause(pauseId);
 }
Example #4
0
 // Changes the time scale back to normal
 public void UnPause(string id)
 {
     PauseHandler.RemovePause(id);
 }