public virtual void AddTransition(StateMachineComponentBase toComponent, StateTransitionRuleBase transitionRuleRule) { if (transitionList == null) { transitionList = new Dictionary <StateMachineComponentBase, StateTransitionRuleBase>(); } transitionList[toComponent] = transitionRuleRule; }
public virtual void Initialise(T owner) { Owner = owner; stateList = new List <StateMachineComponentBase>(); InitialiseStates(); InitialiseBranches(); currentState = GetState(EntryStateName); }
public override StateMachineComponentBase Evaluate() { var nextState = base.Evaluate(); if (nextState != this) { return(nextState); } var newState = currentState.Evaluate(); if (newState != currentState) { currentState = newState; currentState.OnEnter(); } return(this); }
public void AddComponent(StateMachineComponentBase component) { stateList.Add(component); }
public override void OnEnter() { // Initialise the default state. currentState = GetState(EntryStateName); currentState.OnEnter(); }