Beispiel #1
0
        private void PushInternal(IState state)
        {
            // make top state inactive
            IState top;

            if (TryGetTopState(out top))
            {
                top.OnBecomeInactive();
            }

            // setup the state
            state.owner = this;
            _states.Add(state);

            // execute state push steps
            state.PreTransitionIn();
            _transition = state.TransitionIn(_transition);
            state.OnEnterState();
            state.OnBecomeActive();

            //handle next action in our queue
            HandlePendingAction();
        }
Beispiel #2
0
 public void RemoveTransition()
 {
     _transition.owner = null;
     _transition       = null;
 }