Example #1
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.tag == "Player")
        {
            if (basicEnemyBehaviour.GetPlayerReference() == null)
            {
                basicEnemyBehaviour.SetPlayerReference(collision.gameObject);
            }

            basicEnemyBehaviour.ChangeState(BehaviourState.Chasing);
        }
    }
Example #2
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.tag == "Player" && collision.name != "Projectile(Clone)")
     {
         basicEnemyBehaviour.ChangeState(BehaviourState.Attacking);
     }
 }