mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 15:14:50 +00:00
app_builder: add world and scheduler setters
This commit is contained in:
parent
7e0d0c6e3d
commit
fdbe42dd7d
1 changed files with 10 additions and 0 deletions
|
@ -21,6 +21,16 @@ impl AppBuilder {
|
|||
self.app.run();
|
||||
}
|
||||
|
||||
pub fn with_world(mut self, world: World) -> Self {
|
||||
self.app.world = world;
|
||||
self
|
||||
}
|
||||
|
||||
pub fn with_scheduler(mut self, scheduler: SystemScheduler::<AppStage>) -> Self {
|
||||
self.app.scheduler = scheduler;
|
||||
self
|
||||
}
|
||||
|
||||
pub fn setup(mut self, setup: &dyn Fn(&mut World, &mut SystemScheduler<AppStage>)) -> Self {
|
||||
setup(&mut self.app.world, &mut self.app.scheduler);
|
||||
self
|
||||
|
|
Loading…
Reference in a new issue