private void OnCollisionEnter2D(Collision2D collision) { if (collision.gameObject.tag == "Enemigo") { vidas--; if (vidas == 0) { muerte = true; } if (vidas >= 0) { vida.QuitarVida(1); Debug.Log(vida.GetVida()); } } if (collision.gameObject.layer == 7) { numSalto = 0; } }
private void OnCollisionEnter2D(Collision2D collision) { if (collision.gameObject.layer == 3) { vidas--; if (vidas == 0) { muerte = true; } else { Vida.QuitarVida(1); Debug.Log(Vida.GetVida()); } } if (collision.gameObject.layer == 8) { vuela = false; } else { vuela = true; } }