Esempio n. 1
0
        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();
            }
        }
Esempio n. 2
0
 private Type Transistion(ISmState state)
 {
     if (currentState == GoToState.Pulsed)
     {
         return(typeof(MovingState));
     }
     return(null);
 }
Esempio n. 3
0
 private Type DoneTransistion(ISmState state)
 {
     if (currentState != GoToState.Active)
     {
         return(typeof(IdleState));
     }
     return(null);
 }
Esempio n. 4
0
 private Type Transition(ISmState state)
 {
     if (currentState == GoToState.Pulsed)
     {
         return(typeof(SmsGoTo));
     }
     return(null);
 }
Esempio n. 5
0
 private Type Transition(ISmState state)
 {
     if (currentState == GoToState.Pulsed)
     {
         return(GetType());
     }
     return(null);
 }
Esempio n. 6
0
 public void AddState(ISmState state)
 {
     state.Init(this);
     states[state.GetType()] = state;
 }
Esempio n. 7
0
 public Type TransistionCheck(ISmState state)
 {
     return(checkFunc(state));
 }