/// <summary> /// Adds a new state to the StateMachine and pauses the current one if it exists. /// </summary> /// <param name="state"></param> public void PushState(SimState state) { if (CurrentState != null) { CurrentState.Pause(); } if (!activeStates.Contains(state)) { activeStates.Push(state); } CurrentState = state; CurrentState.Start(); }
/// <summary> /// Adds a new state to the StateMachine and pauses the current one if it exists. /// </summary> /// <param name="state"></param> public void PushState(SimState state) { if (CurrentState != null) { CurrentState.Pause(); } CurrentObjectsEnabled = false; if (!activeStates.Contains(state)) { activeStates.Push(state); } CurrentState = state; CurrentObjectsEnabled = true; CurrentState.Start(); }