private void OnCollisionEnter2D(Collision2D collision) { if (collision.gameObject.tag == "Player") { playerDB.setHealth(playerDB.getHealth() - damage); } }
public void isPlayerDeath() { if (playerDB.getHealth() < 0.1f) { Destroy(gameObject); } }