Ejemplo n.º 1
0
    // OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks
    override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
    {
        AgentPatrol ap = animator.GetComponent <AgentPatrol> ();

        if (ap)
        {
            ap.GetClosestNode();
        }
    }
Ejemplo n.º 2
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)
    {
        animator.ResetTrigger("reachedDest");

        AgentPatrol ap = animator.GetComponent <AgentPatrol> ();

        if (ap)
        {
            ap.GetClosestNode();
        }
    }