use bevy::app::AppExit; use bevy::audio::AudioPlugin; use bevy::prelude::*; use bevy::state::app::StatesPlugin; use bevy_asset_loader::prelude::*; #[test] fn multiple_loading_states() { let mut app = App::new(); app.add_plugins(( MinimalPlugins, AssetPlugin::default(), AudioPlugin::default(), StatesPlugin, )); app.init_state::(); #[cfg(feature = "progress_tracking")] app.add_plugins(( iyes_progress::ProgressPlugin::new(MyStates::Splash), iyes_progress::ProgressPlugin::new(MyStates::Load), )); app.add_loading_state( LoadingState::new(MyStates::Splash) .continue_to_state(MyStates::Load) .load_collection::(), ) .add_loading_state( LoadingState::new(MyStates::Load) .continue_to_state(MyStates::Play) .load_collection::() .load_collection::(), ) .add_systems(Update, (quit.run_if(in_state(MyStates::Play)), timeout)) .add_systems(OnEnter(MyStates::Load), use_splash_assets) .add_systems(OnEnter(MyStates::Play), use_loading_assets) .run(); } fn timeout(time: Res