예제 #1
0
    void Loader()
    {
        Time.timeScale = 1;

        MessageCaution.SetActive(false);
        MessageWarning.SetActive(false);

        MessageNice.SetActive(false);
        MessageGood.SetActive(false);
        MessageGreat.SetActive(false);
    }
예제 #2
0
    IEnumerator Contador(int code)
    {
        if (code == 1)
        {
            yield return(new WaitForSeconds(4));

            MessageCaution.SetActive(false);
        }
        else if (code == 2)
        {
            yield return(new WaitForSeconds(3));

            MessageWarning.SetActive(false);
        }
        else if (code == 3)
        {
            yield return(new WaitForSeconds(2));

            MessageNice.SetActive(false);
            MessageGood.SetActive(false);
            MessageGreat.SetActive(false);
        }
    }
예제 #3
0
    void LifeMessages()
    {
        if (player.life == 2 && seenC == false)
        {
            Life3.SetActive(false);
            MessageCaution.SetActive(true);
            StartCoroutine(Contador(1));            //Chama o contador com um código
            seenC = true;
        }

        if (player.life == 1 && seenW == false)
        {
            Life2.SetActive(false);
            MessageCaution.SetActive(false);
            MessageWarning.SetActive(true);
            StartCoroutine(Contador(2));            //Chama o contador com um código
            seenW = true;
        }

        if (player.life == 0)
        {
            SceneManager.LoadScene("GameOver");
        }
    }