public void TogglePause()
    {
        #region If All Windows Closed
        //IF THERE ARE NOW WINDOWS OPEN
        if (Input.GetKeyDown(KeyCode.Escape) &&
            !windowsOpen)    //only activate when all windows are closed
        {
            if (!pauseMenu.activeSelf)
            {
                Cursor.visible = true;
                player.GetComponent <CharControl>().sfxControlScript.ButtonIn();
                pauseMenu.SetActive(true);
                Time.timeScale = 0;
            }
            else if (pauseMenu.activeSelf)
            {
                player.GetComponent <CharControl>().sfxControlScript.ButtonOut();
                ContinueButton();
            }
        }
        #endregion

        #region If Windows Still Open
        //IF THERE ARE WINDOWS STILL OPEN
        if (Input.GetKeyDown(KeyCode.Escape) &&
            windowsOpen)
        {
            for (int i = 0; i < UI_Windows.Length; i++)
            {
                UI_Windows[i].SetActive(false);
            }
            tabs.SetActive(false);
            player.GetComponent <CharControl>().sfxControlScript.InventoryClose();
            charControlScript.UnfreezeCam();
        }
        #endregion
    }
Esempio n. 2
0
 public void Reenabletext()
 {
     talking = false;
     story.currentcharacter = "blank";
     //PressE.enabled = true;
     PressEIcon.enabled  = true;
     avatar.jumpVelocity = 9f;
     avatar.enabled      = true;
     questchecker();
     Cursor.visible           = false;
     dayNightScript.isTalking = false;
     sfxControlScript.ButtonOut(); // play button SFX
     charControlScript.UnfreezeCam();
     heartpointincrease();
 }
Esempio n. 3
0
 private void MenuTabToggle()
 {
     if (Input.GetKeyDown(KeyCode.I) || Input.GetKeyDown(KeyCode.Tab))//Inventory menu toggle via tab button
     {
         if (storycheck.DemoMode == true)
         {
             if (inventory.activeSelf == false)
             {
                 this.gameObject.GetComponent <CharControl>().sfxControlScript.InventoryOpen(); //play sound effect of opening the inventory
                 Controller.FreezeCam();
                 inventory.SetActive(true);
                 Cursor.visible = true;
                 info.enabled   = true;
             }
             else
             {
                 this.gameObject.GetComponent <CharControl>().sfxControlScript.InventoryClose(); //play sound effect of opening the inventory
                 Controller.UnfreezeCam();
                 inventory.SetActive(false);
                 Cursor.visible = false;
                 info.enabled   = false;
             }
         }
         else if (storycheck.DemoMode == false)
         {
             if (inventory2.activeSelf == false)
             {
                 this.gameObject.GetComponent <CharControl>().sfxControlScript.InventoryOpen(); //play sound effect of opening the inventory
                 Controller.FreezeCam();
                 inventory2.SetActive(true);
                 Cursor.visible = true;
                 tabs.SetActive(true);
                 notice.GetComponent <NoticeScript>().Close();
                 //info.enabled = true;
             }
             else
             {
                 this.gameObject.GetComponent <CharControl>().sfxControlScript.InventoryClose(); //play sound effect of opening the inventory
                 Controller.UnfreezeCam();
                 inventory2.SetActive(false);
                 Cursor.visible = false;
                 tabs.SetActive(false);
                 //info.enabled = false;
             }
         }
     }
     if (Input.GetKeyDown(KeyCode.C) && Input.GetKeyDown(KeyCode.T))
     {
         if (Cheats.activeSelf == false)
         {
             Cheats.SetActive(true);
             Cursor.visible = true;
             Controller.FreezeCam();
             Controller.sfxControlScript.ButtonIn();
         }
         else if (Cheats.activeSelf == true)
         {
             Cheats.SetActive(false);
             Cursor.visible = false;
             Controller.UnfreezeCam();
             Controller.sfxControlScript.ButtonOut();
         }
     }
 }