Beispiel #1
0
    public void OnCollisionEnter(Collision collision)
    {
        if (collision.gameObject.tag == "inimigos")
        {
            dano = collision.gameObject.GetComponent <Inimigos>().dano;
        }
        if (collision.gameObject.tag == "itemVida")
        {
            vida += 40;
            sons.GetComponent <Sons>().SomDeHPUP();
            Destroy(collision.gameObject);
        }

        if (collision.gameObject.tag == "municao")
        {
            armaScript.PegarMunicao();
            sons.GetComponent <Sons>().SomDeMunicaoUP();
            Destroy(collision.gameObject);
        }
        if (collision.gameObject.tag == "Nivel 3" && menu.GetComponent <Menu>().contagemZumbis == 0)
        {
            SceneManager.LoadScene("Fase 3 - Usina");
        }
    }