/// This example shows that the builders are compatible with plugins use bevy::{ core::FixedTimestep, prelude::{App, ExclusiveSystemDescriptorCoercion, IntoExclusiveSystem, Plugin}, DefaultPlugins, }; use bevy_prototype_schedule_states::{driver, AppStateHelpers, StatePlugin}; fn main() { App::new() .add_plugins(DefaultPlugins) .add_plugin(StatePlugin::new(States::StateA)) .add_plugin(StateAPlugin) .add_plugin(StateBPlugin) .add_system( driver:: .exclusive_system() .with_run_criteria(FixedTimestep::step(1.0)), ) .run(); } #[derive(PartialEq, Eq, Hash, Clone, Copy)] enum States { StateA, StateB, } struct StateAPlugin; impl Plugin for StateAPlugin { fn build(&self, app: &mut App) { app.add_system_to_update(States::StateA, || println!("update state a")); } } struct StateBPlugin; impl Plugin for StateBPlugin { fn build(&self, app: &mut App) { app.add_system_to_update(States::StateB, || println!("update state b")); } }