예제 #1
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.gameObject.tag.Equals("Enemy"))
     {
         Enemy enemy = other.gameObject.GetComponent <Enemy>();
         if (enemy.type != this.type)
         {
             return;
         }
         shootEnemy.AddEnemyInRange(other.gameObject);
         enemy.observers.Add(shootEnemy);
     }
 }