Esempio n. 1
0
    public void OpenMenu()
    {
        Menu.SetActive(true);

        //pause all game content (ghosts, pets)
        PetUtility.PauseGame();
    }
Esempio n. 2
0
 public void levelLost()
 {
     loseScreen.SetActive(true);
     toTown.gameObject.SetActive(true);
     retry.gameObject.SetActive(true);
     nightTime.SetActive(false);
     dayTime.SetActive(true);
     PetUtility.PauseGame();
 }
Esempio n. 3
0
 public void levelWon()
 {
     if (levelNumber < 6)
     {
         winScreen.SetActive(true);
         toTown.gameObject.SetActive(true);
         nextLvl.gameObject.SetActive(true);
         nightTime.SetActive(false);
         dayTime.SetActive(true);
         PetUtility.PauseGame();
     }
     else
     {
         //all levels are finished
         winScreen.SetActive(true);
         resetButton.SetActive(true);
         nightTime.SetActive(false);
         dayTime.SetActive(true);
         PetUtility.PauseGame();
     }
 }
Esempio n. 4
0
    private bool btnLastState = false; //the last state of the toggle, so we don't repeatly continue the game


    public void Update()
    {
        if (toggle.isOn == true)
        {
            background.sprite = pauseImage;

            pauseCentreText.SetActive(false);
            FadePanel.SetActive(false);

            //resume all game content (ghosts, pets) (same as a method in the MenuPopup script)
            if (!btnLastState)
            {
                PetUtility.ContinueGame();
            }
            btnLastState  = true;
            menuB.enabled = true;
        }


        if (toggle.isOn == false)
        {
            background.sprite = playImage;

            FadePanel.SetActive(true);
            pauseCentreText.SetActive(true);

            //pause all game content (ghosts, pets) (same as a method in the MenuPopup script)
            PetUtility.PauseGame();
            if (btnLastState)
            {
                PetUtility.PauseGame();
            }
            btnLastState  = false;
            menuB.enabled = false;
        }
    }