// 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) { finishEating = false; astar = animator.GetComponent <AStarNavigation>(); wormFSM = animator.GetComponent <WormFSM>(); astar.ChangeGoalPosition(wormFSM.foodAgent.transform.position); astar.Speed = wormFSM.chaseSpeed;//Increase speed }
// 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) { wormFSM = animator.GetComponent <WormFSM>(); wormFSM.GrowNewBody(); }
// 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) { astar = animator.GetComponent <AStarNavigation>(); wormFSM = animator.GetComponent <WormFSM>(); }