Leaving a State

  1. If the state contains active substates, their exit actions are executed. The exit action of the innermost basis state is executed first.
  2. The exit action of the state is executed.
  3. The state is deactivated.