public void OnTriggerExit2D(Collider2D hit) { PlayerHealthScript target = hit.gameObject.GetComponent <PlayerHealthScript>(); if (target && !target.HasMaxHealth) { target.Heal(healthValue); Destroy(gameObject); } }
public void OnTriggerExit2D(Collider2D hit) { PlayerHealthScript target = hit.gameObject.GetComponent <PlayerHealthScript>(); if (target && !target.HasMaxHealth) { target.Heal(healthValue); Destroy(gameObject); } }