HidePausePanel() public method

public HidePausePanel ( ) : void
return void
Beispiel #1
0
 public void UnPause()
 {
     //Set isPaused to false
     isPaused = false;
     //Set time.timescale to 1, this will cause animations and physics to continue updating at regular speed
     Time.timeScale = 1;
     //call the HidePausePanel function of the ShowPanels script
     showPanels.HidePausePanel();
 }
Beispiel #2
0
    private void Update()
    {
        if (!menu.notInMenu)
        {
            if (Input.GetKeyDown(KeyCode.RightArrow) || Input.GetKeyDown(KeyCode.D))
            {
                if (onResume)
                {
                    onResume = false;
                }
                resume.GetComponent <Image>().color = normalColor;
                goMenu.GetComponent <Image>().color = highlightedColor;
                butSound.ButtonChangeSound();
            }
            if (Input.GetKeyDown(KeyCode.LeftArrow) || Input.GetKeyDown(KeyCode.A))
            {
                if (!onResume)
                {
                    onResume = true;
                }
                resume.GetComponent <Image>().color = highlightedColor;
                goMenu.GetComponent <Image>().color = normalColor;
                butSound.ButtonChangeSound();
            }

            if (Input.GetButtonDown("Submit"))
            {
                butSound.OnClickSound();

                if (onResume)
                {
                    pauseScript.UnPause();
                    showpanels.HidePausePanel();
                }
                else
                {
                    pauseScript.UnPause();
                    showpanels.HidePausePanel();
                    showpanels.ShowMenu();
                    SceneManager.LoadScene(0);
                }
            }
        }
    }
Beispiel #3
0
 public void UnPause()
 {
     GameObject.FindGameObjectWithTag("SoundSystem").GetComponent <SoundSystemController> ().VolumeNormal();
     //Set isPaused to false
     isPaused = false;
     //Set time.timescale to 1, this will cause animations and physics to continue updating at regular speed
     Time.timeScale = 1;
     //call the HidePausePanel function of the ShowPanels script
     showPanels.HidePausePanel();
 }
Beispiel #4
0
    /// <summary>
    /// Handles un pauses
    /// </summary>
    public void UnPauseGame()
    {
        isPaused = false;

        // release music
        AudioListener.pause = false;
        Time.timeScale      = 1;

        showPanels.HidePausePanel();
        showPanels.ShowGameButtons();
    }
Beispiel #5
0
    public void ReturnToMenu()
    {
        showPanels = GetComponent <ShowPanels>();
        ui         = GetComponent <StartOptions>();
        showPanels.HidePausePanel();
        showPanels.ShowMenu();
        ui.changeScenes = false;
        ui.inMainMenu   = true;

        SceneManager.LoadScene(0);
    }
Beispiel #6
0
 public void UnPause()
 {
     GameStateManager.Instance.IsGamePaused = false;
     showPanels.ShowUiOverlayCanvas();
     //Set isPaused to false
     isPaused = false;
     //Set time.timescale to 1, this will cause animations and physics to continue updating at regular speed
     Time.timeScale = 1;
     //call the HidePausePanel function of the ShowPanels script
     showPanels.HidePausePanel();
 }
Beispiel #7
0
 public void UnPause()
 {
     //i'm making a new adjustment since I moved Pause.cs from UI to Game Manager. ======================================================================================================
     showPanels = FindObjectOfType <ShowPanels>();
     //Set isPaused to false
     isPaused = false;
     //Set time.timescale to 1, this will cause animations and physics to continue updating at regular speed
     Time.timeScale = 1;
     //call the HidePausePanel function of the ShowPanels script
     showPanels.HidePausePanel();
     Debug.LogError("unpause is triggered");
 }
Beispiel #8
0
 public void UnPause()
 {
     //Set isPaused to false
     isPaused = false;
     //Set time.timescale to 1, this will cause animations and physics to continue updating at regular speed
     Time.timeScale = 1;
     //call the HidePausePanel function of the ShowPanels script
     showPanels.HidePausePanel();
     if (!SceneManager.GetActiveScene().name.Equals("Menu"))
     {
         Cursor.visible = false;
     }
 }
Beispiel #9
0
    /// <summary>
    /// back to main menu from in game
    /// </summary>
    public void BackToMainMenu()
    {
        InMainMenu = true;

        showPanels.HidePausePanel();
        showPanels.ShowMenuPanel();
        showPanels.ToggleBackground(true);
        showPanels.HideGameButtons();
        music.PlayMenuMusic();

        // scene 0 is the main menu (HARDOCODED)
        SceneManager.LoadScene(0);
    }
Beispiel #10
0
    public void UnPause()
    {
        isPaused = false;

        if (playerActive)
        {
            Time.timeScale      = 1;
            Game.Loader.loading = true;
            Game.Active         = true;
            playerActive        = false;
        }

        showPanels.HidePausePanel();
    }
Beispiel #11
0
 public void UnPause()
 {
     if (!startScript.inMainMenu)
     {
         //Set isPaused to false
         isPaused = false;
         //Set time.timescale to 1, this will cause animations and physics to continue updating at regular speed
         Time.timeScale = 1;
         //call the HidePausePanel function of the ShowPanels script
         showPanels.HidePausePanel();
         // Unfreeze the camera
         cameraController.Unfreeze();
     }
 }
Beispiel #12
0
    public void UnPause()
    {
        //Set isPaused to false
        isPaused = false;
        //Set time.timescale to 1, this will cause animations and physics to continue updating at regular speed
        Time.timeScale = 1;
        //call the HidePausePanel function of the ShowPanels script
        showPanels.HidePausePanel();
        FirstPersonController fpc = GameObject.FindObjectOfType <FirstPersonController>();

        fpc.enabled      = true;
        Cursor.lockState = CursorLockMode.Locked;
        Cursor.visible   = true;
    }
Beispiel #13
0
 public void UnPause()
 {
     //Set isPaused to false
     isPaused = false;
     //Set time.timescale to 1, this will cause animations and physics to continue updating at regular speed
     Time.timeScale = 1;
     //call the HidePausePanel function of the ShowPanels script
     showPanels.HidePausePanel();
     if (Application.loadedLevelName == "Main")
     {
         GameObject.Find("control").GetComponent <control> ().ShowCanvas();
     }
     if (Application.loadedLevelName == "GameOver")
     {
         GameObject.Find("GameOverControl").GetComponent <GameOverQuit> ().ShowCanvas();
     }
 }
Beispiel #14
0
    // Restarts the game
    public void UnEndGame()
    {
        ScoreScript.money = 0;

        // Reloads the game scene
        SceneManager.LoadScene(SceneManager.GetActiveScene().name);

        //Set isPaused to false
        isPaused = false;

        //Set time.timescale to 1, this will cause animations and physics to continue updating at regular speed
        Time.timeScale = 1;

        // Removies the end game panels
        showPanels.HidePausePanel();
        showPanels.HideWinGamePanel();
        showPanels.HideLoseGamePanel();
    }
Beispiel #15
0
 public void UnPause()
 {
     if (!isGameOver)
     {
         //Set isPaused to false
         isPaused = false;
         //Set time.timescale to 1, this will cause animations and physics to continue updating at regular speed
         Time.timeScale = 1;
         //call the HidePausePanel function of the ShowPanels script
         showPanels.HidePausePanel();
         //unpause game music
         try
         {
             audioManager.UnPauseMusic();
         }
         catch { }
     }
 }
Beispiel #16
0
    public void UnPause()
    {
        //Set isPaused to false
        isPaused = false;
        //Set time.timescale to 1, this will cause animations and physics to continue updating at regular speed
        Time.timeScale = 1;
        //call the HidePausePanel function of the ShowPanels script
        showPanels.HidePausePanel();
        Scene  currentScene = SceneManager.GetActiveScene();
        string sceneName    = currentScene.name;

        if (sceneName == "Title")
        {
            Cursor.lockState = CursorLockMode.None;
        }
        else
        {
            Cursor.lockState = CursorLockMode.Locked;
        }
    }
Beispiel #17
0
    public void UnPause()
    {
        GameObject   playerFPS    = GameObject.FindGameObjectWithTag("PlayerFPS");
        GameObject   mainCamera   = GameObject.FindGameObjectWithTag("MainCamera");
        GameObject   player       = GameObject.FindGameObjectWithTag("Player");
        PlayerHealth playerHealth = player.GetComponent <PlayerHealth>();

        if (!playerHealth.isPlayerDead())
        {
            playerFPS.GetComponent <MouseLook>().enabled      = true;
            playerFPS.GetComponent <CharacterMotor>().enabled = true;
            mainCamera.GetComponent <MouseLook>().enabled     = true;
        }
        hudCanvas.SetActive(true);

        //Set isPaused to false
        isPaused = false;
        //Set time.timescale to 1, this will cause animations and physics to continue updating at regular speed
        Time.timeScale = 1;
        //call the HidePausePanel function of the ShowPanels script
        showPanels.HidePausePanel();
    }
Beispiel #18
0
    public void MainMenu()
    {
//		Destroy(this.transform.parent.gameObject);
//		Destroy(GameObject.Find("EventSystem"));
//		Destroy(GameObject.Find("UI"));
////		GameObject("EventSystem")
//		showPanels.HidePausePanel ();
////		SceneManager.CreateScene (1);
//		SceneManager.UnloadSceneAsync (1);
//
        SceneManager.LoadScene(0);

//		Destroy(GameObject.Find("showPanels"));

//		SceneManager.GetSceneAt (1);

//		GameObject.Destroy (SceneManager.GetSceneAt (1);
//		Application.LoadLevel ("scene");

        SceneManager.UnloadSceneAsync(startOptions.sceneToStart);

        showPanels.HidePausePanel();
    }
Beispiel #19
0
 private void HidePausePanelAndEnablePlayerControl()
 {
     _showPanels.HidePausePanel();
 }
Beispiel #20
0
 public void UnPause()
 {
     isPaused       = false;
     Time.timeScale = 1;
     showPanels.HidePausePanel();
 }
Beispiel #21
0
 private void HidePausePanelAndEnablePlayerControl()
 {
     _startScript.SetPlayerState(true);
     _showPanels.HidePausePanel();
 }