private void OnTriggerStay2D(Collider2D other) { NPC npc = other.gameObject.GetComponentInChildren <NPC>(); if (npc != null) { if (npcTimer.CheckTimerForEffect(npc)) { EffectBody(npc); } } }
private void OnTriggerStay2D(Collider2D other) { if (other.CompareTag("Enemy") || other.CompareTag("Obstacle")) { NPC npc = other.GetComponentInChildren <NPC>(); if (npcTimer.CheckTimerForEffect(npc)) { AudioManager.Instance.PlaySound("Voices/Magic2"); DamageEffectBody(npc); } } }