From ff21061897f9fa13c1b57e842ae0e9c7e34bf87c Mon Sep 17 00:00:00 2001 From: Boiethios Date: Thu, 17 Sep 2020 11:18:14 +0200 Subject: [PATCH] Add AppBuilder::add_startup_stage_[before/after] --- crates/bevy_app/src/app_builder.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/crates/bevy_app/src/app_builder.rs b/crates/bevy_app/src/app_builder.rs index 1ec4f0a837134..548b89828660d 100644 --- a/crates/bevy_app/src/app_builder.rs +++ b/crates/bevy_app/src/app_builder.rs @@ -74,6 +74,28 @@ impl AppBuilder { self } + pub fn add_startup_stage_after( + &mut self, + target: &'static str, + stage_name: &'static str, + ) -> &mut Self { + self.app + .startup_schedule + .add_stage_after(target, stage_name); + self + } + + pub fn add_startup_stage_before( + &mut self, + target: &'static str, + stage_name: &'static str, + ) -> &mut Self { + self.app + .startup_schedule + .add_stage_before(target, stage_name); + self + } + pub fn add_system(&mut self, system: Box) -> &mut Self { self.add_system_to_stage(stage::UPDATE, system) }