private void OnTriggerStay2D(Collider2D other) { if (other.gameObject.name == "Fire" && currentCooldown <= 0) { hc.Hurt(); currentCooldown = damageCooldown; } }
public void DoDamage(int attack) { healthComponent.Hurt(attack); animator.SetTrigger("hurt"); audioSource.clip = hurtClip; audioSource.Play(); }
private void OnTriggerStay2D(Collider2D other) { if (other.gameObject.name.Contains("Fire") && currentCooldown <= 0) { healthComponent.Hurt(); currentCooldown = damageCooldown; } }
private void OnTriggerEnter2D(Collider2D other) { if (other.gameObject.name == "Player") { HealthComponent hc = other.gameObject.GetComponent <HealthComponent>(); hc.Hurt(); SFXHelper.PlayEffect(SFXs.ReceiveDamage); } }