// 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); }
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); } }
// Moving the scene to the main menu scene public void Menu() { SceneManager.LoadScene(LoadLevelManager.MainMenuRef); PauseHandler.RemovePause(pauseId); }
// Changes the time scale back to normal public void UnPause(string id) { PauseHandler.RemovePause(id); }