Macro de_core::nested_state

source ·
macro_rules! nested_state {
    (
        $parent:ident::$parent_variant:ident -> $name:ident,
        doc = $doc:expr,
        $(enter = $enter:ident,)?
        $(exit = $exit:ident,)?
        variants = {
            $($variant:ident),* $(,)?
        }
    ) => { ... };
}
Expand description

Creates a Bevy state and a Bevy plugin.

The child state is bound to a given parent state with this syntax: ParentState::ParentVariant -> ChildState.

Transitions of the child state are scheduled after transitions of the parent state.

Variant None is automatically added to the child state. Additional variants are configurable with variants argument.

None variant of the child state is entered when the given variant of the parent state is exited. The enter system is called on enter of the parent variant and the exit system is called on exit of the parent variant.