use bevy_ecs::prelude::*; use bevy_app::{prelude::*, ScheduleRunnerPlugin}; use bevy_mod_progress::*; enum Loading {} fn main() { let mut app = App::new(); app.add_plugins(ScheduleRunnerPlugin::default()); app.add_plugins(EntityProgressTrackingPlugin::::default()); app.add_systems(Update, tracking_system); app.world_mut().spawn(Progress::::new()); app.observe(completion_observer); app.run(); } fn tracking_system( mut tracked: Query<&mut Progress>, ) { for mut tracker in &mut tracked { tracker.track(128, 128); } } fn completion_observer( _trigger: Trigger>, mut exit: EventWriter, ) { exit.send(AppExit::Success); }