Function bevy::ecs::schedule::apply_state_transition
source · pub fn apply_state_transition<S>(world: &mut World)where
S: States,
Expand description
If a new state is queued in NextState<S>
, this system:
- Takes the new state value from
NextState<S>
and updatesState<S>
. - Sends a relevant
StateTransitionEvent
- Runs the [
OnExit(exited_state)
] schedule, if it exists. - Runs the
OnTransition { from: exited_state, to: entered_state }
, if it exists. - Runs the [
OnEnter(entered_state)
] schedule, if it exists.