Esempio 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)
 {
     if (animatorFSM.GetIdlePauseTimer() < animatorFSM.GetIdlePauseTime())
     {
         animatorFSM.SetIdlePauseTimer(animatorFSM.GetIdlePauseTimer() + Time.deltaTime);
     }
     else
     {
         animator.SetTrigger(animator_PatrolTrigger);
     }
 }
Esempio n. 2
0
    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());
    }