private static IEnumerator DoStateThenGoTo(StateMachine stateMachine, TimelineStateRef TimelineState, TimelineStateRef goToState) { yield return(stateMachine.StartCoroutine(TimelineStateMachine.Run(stateMachine, TimelineState))); stateMachine.GoToState(TimelineStateMachine.Run(stateMachine, goToState)); yield break; }
public eEventTriggerReturn Update(StateMachine stateMachine, float eventTime) { if (_condition.IsConditionMet(stateMachine)) { stateMachine.GoToState(TimelineStateMachine.Run(stateMachine, _state)); return(eEventTriggerReturn.EventFinishedExitState); } return(eEventTriggerReturn.EventOngoing); }
public eEventTriggerReturn Trigger(StateMachine stateMachine) { switch (_stateType) { case eStateType.Coroutine: { stateMachine.GoToState(_coroutine.RunCoroutine()); } break; case eStateType.Timeline: { stateMachine.GoToState(TimelineStateMachine.Run(stateMachine, _state)); } break; } return(eEventTriggerReturn.EventFinishedExitState); }
public eEventTriggerReturn Trigger(StateMachine stateMachine) { eEventTriggerReturn ret = eEventTriggerReturn.EventFinished; if (_condition != null) { _condition.OnStartConditionChecking(stateMachine); if (_condition.IsConditionMet(stateMachine)) { stateMachine.GoToState(TimelineStateMachine.Run(stateMachine, _state)); ret = eEventTriggerReturn.EventFinishedExitState; } if (_duration > 0.0f) { ret = eEventTriggerReturn.EventOngoing; } } return(ret); }
public IEnumerator GetGoToState(StateMachine stateMachine) { return(TimelineStateMachine.Run(stateMachine, _goToState)); }
void Start() { StateMachine stateMachine = GetComponent <StateMachine>(); stateMachine.GoToState(TimelineStateMachine.Run(stateMachine, _initialState)); }