Ejemplo n.º 1
0
    private IEnumerator AttackPlayer()
    {
        attackingPlayer = true;
        while (attackingPlayer)
        {
            NavAgent.isStopped = true;
            NavAgent.ResetPath();
            NavAgent.velocity = Vector3.zero;
            MobAnimator.SetBool("Move", false);
            if (aiState == AI_TraceAndAttack_State.Death)
            {
                yield break;
            }
            MobAnimator.SetBool("Attack", true);
            Controller.ExecuteAttack();
            yield return(new WaitForSeconds(AttackActionLength));

            if (aiState == AI_TraceAndAttack_State.AttackPlayer)
            {
                MobAnimator.SetBool("Attack", false);
            }
        }
        NavAgent.isStopped = false;
    }