Trait bevy_states_utils::AppExtension

source ·
pub trait AppExtension {
    // Required methods
    fn add_gc_state<S: States>(&mut self);
    fn add_gc_resource<S: States, R: Resource>(&mut self, state: S);
    fn add_substate<P: States, S: States + Default>(
        &mut self,
        parent: P,
        sub: S
    );
}
Expand description

Extension trait for bevy::prelude::App

Required Methods§

source

fn add_gc_state<S: States>(&mut self)

This adds registers the required systems for Gc<S> to work

source

fn add_gc_resource<S: States, R: Resource>(&mut self, state: S)

Mark a resource to be removed when exsiting a specific stage

source

fn add_substate<P: States, S: States + Default>(&mut self, parent: P, sub: S)

Setup nested states, when the parent state enters the specified state the child will be switched into the given state, if the parent leavs the state the child will be switched to its default state

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl AppExtension for App

source§

fn add_gc_state<S: States>(&mut self)

source§

fn add_gc_resource<S: States, R: Resource>(&mut self, expected_state: S)

source§

fn add_substate<P: States, S: States + Default>(&mut self, parent: P, sub: S)

Implementors§