예제 #1
0
 void OnTriggerExit2D(Collider2D other)
 {
     if (ai.currentState != EnemyState.dead)
     {
         if (other.gameObject.tag == "Player")
         {
             ai.following    = false;
             ai.currentState = EnemyState.retreating;
             ai.UpdatePath();
         }
     }
 }
예제 #2
0
    void OnTriggerEnter2D(Collider2D other)
    {
        if (ai.currentState == EnemyState.dead)
        {
            return;
        }
        else if (other.gameObject.tag == "Player")
        {
            ai.following    = true;
            ai.currentState = EnemyState.aggro;
            ai.UpdatePath();

            multiPull = new List <Collider2D>(Physics2D.OverlapCircleAll(center.position, multiPullRange, enemyLayers));    //Check which enemies are within his swarm range
            foreach (Collider2D enemy in multiPull)
            {
                SendMessage("Aggro");
            }
        }
    }
예제 #3
0
 public void EndShockwave()
 {
     ai.attacking    = false;
     ai.currentState = EnemyState.flee;
     ai.UpdatePath();
 }