public void ChangeState(MonoState newState) { if (_currentState == newState) { return; } if (_currentState != null) { _currentState.transitionOut.Raise(); } _currentState = newState; _currentState.transitionIn.Raise(); }
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(); } } }
static SimpleEvents() { _monoState = new MonoState(); }