void OnTriggerExit2D(Collider2D other) { if (ai.currentState != EnemyState.dead) { if (other.gameObject.tag == "Player") { ai.following = false; ai.currentState = EnemyState.retreating; ai.UpdatePath(); } } }
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"); } } }
public void EndShockwave() { ai.attacking = false; ai.currentState = EnemyState.flee; ai.UpdatePath(); }