pub fn update(&mut self, data: StateData<'_, T>) {
        let StateData {
            context: state_manager,
            world,
            data,
        } = data;
        if self.running {
            let trans = match self.state_stack.last_mut() {
                Some(state) => {
                    #[cfg(feature = "profiler")]
                    profile_scope!("stack update");
                    state.update(StateData {
                        context: state_manager,
                        world,
                        data,
                    })
                }
                None => Trans::None,
            };
            for state in &mut self.state_stack {
                #[cfg(feature = "profiler")]
                profile_scope!("stack shadow_update");
                state.shadow_update(StateData {
                    context: state_manager,
                    world,
                    data,
                });
            }

            {
                #[cfg(feature = "profiler")]
                profile_scope!("stack transition");
                self.transition(
                    trans,
                    StateData {
                        context: state_manager,
                        world,
                        data,
                    },
                );
            }
        }
    }
/// Updates the currently active state immediately.
Updates the currently active state immediately.
Updates the currently active state immediately .
pub fn update(&mut self, data: StateData<'_, T>) {
        let StateData {
            context: state_manager,
            world,
            data,
        } = data;
        if self.running {
            let trans = match self.state_stack.last_mut() {
                Some(state) => {
                    #[cfg(feature = "profiler")]
                    profile_scope!("stack update");
                    state.update(StateData {
                        context: state_manager,
                        world,
                        data,
                    })
                }
                None => Trans::None,
            };
            for state in &mut self.state_stack {
                #[cfg(feature = "profiler")]
                profile_scope!("stack shadow_update");
                state.shadow_update(StateData {
                    context: state_manager,
                    world,
                    data,
                });
            }
            {
                #[cfg(feature = "profiler")]
                profile_scope!("stack transition");
                self.transition(
                    trans,
                    StateData {
                        context: state_manager,
                        world,
                        data,
                    },
                );
            }
        }
    }
pub fn update ( & mut self , data : StateData < ' _ , T > ) { let StateData { context : state_manager , world , data , } = data ; if self . running { let trans = match self . state_stack . last_mut ( ) { Some ( state ) => { # [ cfg ( feature " " ) ] profile_scope ! ( " " ) ; state . update ( StateData { context : state_manager , world , data , } ) } None => Trans :: None , } ; for state in & mut self . state_stack { # [ cfg ( feature " " ) ] profile_scope ! ( " " ) ; state . shadow_update ( StateData { context : state_manager , world , data , } ) ; } { # [ cfg ( feature " " ) ] profile_scope ! ( " " ) ; self . transition ( trans , StateData { context : state_manager , world , data , } , ) ; } } }
Updates the currently active state immediately.
Updates the currently active state immediately .
&mut self
data
StateData<'_, T>
&mut self
data
StateData<'_, T>