public void Switch(Type T) { if (CurrentState != null) { if (!permitLoopTransistion && (CurrentState.GetType() == T)) { return; } ((MonoBehaviour)CurrentState).enabled = false; CurrentState.Exit(); } if (enableStackedStates) { currentStates.Push(states[T]); } else { currentState = states[T]; } ((MonoBehaviour)CurrentState).enabled = true; CurrentState.Enter(); if (orderTransistions) { CurrentState.Transistions.Sort(); } }
private Type Transistion(ISmState state) { if (currentState == GoToState.Pulsed) { return(typeof(MovingState)); } return(null); }
private Type DoneTransistion(ISmState state) { if (currentState != GoToState.Active) { return(typeof(IdleState)); } return(null); }
private Type Transition(ISmState state) { if (currentState == GoToState.Pulsed) { return(typeof(SmsGoTo)); } return(null); }
private Type Transition(ISmState state) { if (currentState == GoToState.Pulsed) { return(GetType()); } return(null); }
public void AddState(ISmState state) { state.Init(this); states[state.GetType()] = state; }
public Type TransistionCheck(ISmState state) { return(checkFunc(state)); }