Exemplo n.º 1
0
    // OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
    override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    {
        RandomEnemyAi enemyAi = animator.gameObject.GetComponent <RandomEnemyAi>();

        enemyAi.StartChasing();
    }
Exemplo n.º 2
0
 void OnTriggerEnter2D(Collider2D other)
 {
     enemyAi.StartChasing();
 }