Exemplo n.º 1
0
    public void StepTwo()
    {
        if (twoDone)
        {
            return;
        }
        if (!started)
        {
            started = true;
            if (target == null)
            {
                target = FindObjectOfType <Pet>();
            }
            tutor.ShowStepTwo();
            PetUtility.TutorialPause();
            EventManager.TriggerEvent(GameEvent.scrollFreezed);
        }

        if (target.rest)
        {
            tutor.CloseStepTwo();
            started = false;
            PetUtility.ContinueGame();
            EventManager.TriggerEvent(GameEvent.scrollUnfreezed);
            twoDone = true;
        }
    }
Exemplo n.º 2
0
 public void BackToGame()
 {
     Menu.SetActive(false);
     pauseB.enabled = true;
     //game resumes, same as method in the PauseGame script
     PetUtility.ContinueGame();
 }
Exemplo n.º 3
0
    public void StepFour()
    {
        if (fourDone)
        {
            return;
        }
        if (!started)
        {
            //disable all other beds
            deactivated.Clear();
            foreach (Bed bed in FindObjectsOfType <Bed>())
            {
                if (bed != desiredBed2 && !bed.IsOccupied())
                {
                    bed.gameObject.SetActive(false);
                    deactivated.Add(bed);
                }
            }
            //cover up all other cards
            //a pommy is draged into desired beds
            tutor.ShowStepFour();
            PetUtility.TutorialPause();
            started = true;
            EventManager.TriggerEvent(GameEvent.scrollFreezed);
        }

        if (desiredBed2.IsOccupied())
        {
            //reactivate all other beds
            foreach (Bed bed in deactivated)
            {
                bed.gameObject.SetActive(true);
            }
            tutor.CloseStepFour();
            PetUtility.ContinueGame();
            started  = false;
            fourDone = true;
            EventManager.TriggerEvent(GameEvent.scrollUnfreezed);
        }
    }
Exemplo n.º 4
0
    public void StepThree()
    {
        if (threeDone)
        {
            return;
        }
        if (!started)
        {
            tutor.ShowStepThree();
            PetUtility.TutorialPause();
            started = true;
            EventManager.TriggerEvent(GameEvent.scrollFreezed);
        }

        if (InputManager.InputIsPressing())
        {
            tutor.CloseStepThree();
            PetUtility.ContinueGame();
            started   = false;
            threeDone = true;
            EventManager.TriggerEvent(GameEvent.scrollUnfreezed);
        }
    }
Exemplo n.º 5
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;
        }
    }
Exemplo n.º 6
0
    public void StepSix()
    {
        if (sixDone)
        {
            return;
        }
        if (!started)
        {
            tutor.ShowStepSix();
            PetUtility.TutorialPause();
            started = true;
            EventManager.TriggerEvent(GameEvent.scrollUnfreezed);
        }

        if (InputManager.InputIsPressing())
        {
            tutor.CloseStepSix();
            PetUtility.ContinueGame();
            started = false;
            sixDone = true;
            Destroy(gameObject);
            EventManager.TriggerEvent(GameEvent.scrollUnfreezed);
        }
    }