Esempio n. 1
0
    public void win()
    {
        wonGame = true;
        winText.SetActive(true);
        menuScript ms = GameObject.FindWithTag("Menu").GetComponent <menuScript>();

        ms.Restarting();
        Time.timeScale = 0;
    }
Esempio n. 2
0
    //Handle player Damage
    //To-do: player death
    public void takeDamage(int dmg)
    {
        rb2d.velocity = Vector2.zero;
        hp           -= dmg;
        setHpCounter();
        hurteffects();

        if (hp <= 0)
        {
            LoseText.SetActive(true);
            menuScript ms = GameObject.FindWithTag("Menu").GetComponent <menuScript>();
            ms.Restarting();
            Time.timeScale = 0;
        }
    }