Esempio n. 1
0
 public void ChangeState(MonoState newState)
 {
     if (_currentState == newState)
     {
         return;
     }
     if (_currentState != null)
     {
         _currentState.transitionOut.Raise();
     }
     _currentState = newState;
     _currentState.transitionIn.Raise();
 }
Esempio n. 2
0
 public static void GotoState(this MonoBehaviour m, MonoState mb)
 {
     MonoState[] states = m.GetComponentsInChildren <MonoState>();
     for (int i = 0; i < states.Length; i++)
     {
         if (states[i] != mb)
         {
             states[i].SetStateInActive();
         }
         else if (states[i] == mb)
         {
             states[i].SetStateActive();
         }
     }
 }
Esempio n. 3
0
 static SimpleEvents()
 {
     _monoState = new MonoState();
 }