private void OnTriggerEnter2D(Collider2D other) { if (other.CompareTag("Enemy") || other.CompareTag("Obstacle")) { NPC npc = other.GetComponentInChildren <NPC>(); npcTimer.addNpc(npc); } }
private void OnTriggerEnter2D(Collider2D other) { NPC npc = other.gameObject.GetComponentInChildren <NPC>(); if (npc != null) { npcTimer.addNpc(npc); } }