Skip to content

Commit

Permalink
Hard code which schedule is run in App::update
Browse files Browse the repository at this point in the history
  • Loading branch information
alice-i-cecile committed Jan 19, 2023
1 parent d4da305 commit 366e867
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions crates/bevy_app/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,6 @@ pub struct App {
///
/// This is initially set to [`CoreSchedule::Main`].
pub default_schedule_label: BoxedScheduleLabel,
/// The schedule that controls the outer loop of schedule execution.
///
/// This is initially set to [`CoreSchedule::Outer`].
pub outer_schedule_label: BoxedScheduleLabel,
sub_apps: HashMap<AppLabelId, SubApp>,
plugin_registry: Vec<Box<dyn Plugin>>,
plugin_name_added: HashSet<String>,
Expand All @@ -101,9 +97,9 @@ struct SubApp {
}

impl SubApp {
/// Runs the `SubApp`'s default schedule.
/// Runs the `SubApp`'s [`CoreSchedule::Main`] schedule.
pub fn run(&mut self) {
self.app.world.run_schedule(self.app.default_schedule_label);
self.app.world.run_schedule(CoreSchedule::Main);
self.app.world.clear_trackers();
}

Expand Down Expand Up @@ -164,7 +160,6 @@ impl App {
plugin_registry: Vec::default(),
plugin_name_added: Default::default(),
default_schedule_label: Box::new(CoreSchedule::Main),
outer_schedule_label: Box::new(CoreSchedule::Outer),
is_building_plugin: false,
}
}
Expand All @@ -174,8 +169,8 @@ impl App {
/// This method also updates sub apps.
/// See [`add_sub_app`](Self::add_sub_app) and [`run_once`](Schedule::run_once) for more details.
///
/// The schedule run by this method is determined by the [`outer_schedule_label`](App) field.
/// In normal usage, this is [`CoreSchedule::Outer`], which will run [`CoreSchedule::Startup`]
/// The [`CoreSchedule::Outer`] is run once.
/// With default configuration this will run [`CoreSchedule::Startup`]
/// the first time the app is run, and [`CoreSchedule::Main`] afterwards.
///
/// # Panics
Expand All @@ -185,7 +180,7 @@ impl App {
#[cfg(feature = "trace")]
let _bevy_frame_update_span = info_span!("frame").entered();

self.run_schedule(self.outer_schedule_label);
self.run_schedule(CoreSchedule::Outer);

for sub_app in self.sub_apps.values_mut() {
sub_app.extract(&mut self.world);
Expand Down

0 comments on commit 366e867

Please sign in to comment.