public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { inim = animator.GetComponentInParent <IAInimigo>(); agente = animator.GetComponentInParent <NavMeshAgent>(); // Não permite repetiro ponto do { alvo = inim.pontos[Random.Range(0, inim.pontos.Length)].position; } while (proximoAlvo()); // Manda mover para o ponto agente.SetDestination(alvo); }
public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { inim = animator.GetComponentInParent <IAInimigo>(); agente = animator.GetComponentInParent <NavMeshAgent>(); }