// OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { if (animatorFSM.GetPatrolReachedPoint()) { animatorFSM.SetPatrolReachedPoint(false); animator.SetTrigger(animator_IdleTrigger); } }
private void UpdateUI() { if (fsm.GetRobotState() == AnimatorFSM.RobotStates.Idle) { StartTimer(); } else { StopTimer(); } stateText.text = fsm.GetRobotState().ToString(); distanceDropdown.SetValueWithoutNotify((int)fsm.GetRobotToPlayerDistance()); idlePauseTimeInputField.text = fsm.GetIdlePauseTime().ToString(); reachedPatrolPointToggle.SetIsOnWithoutNotify(fsm.GetPatrolReachedPoint()); canSeePlayerToggle.SetIsOnWithoutNotify(fsm.GetPlayerVisibility()); playerIsDeadToggle.SetIsOnWithoutNotify(fsm.GetPlayerStatus()); }