mirror of
https://github.com/bevyengine/bevy
synced 2024-11-26 14:40:19 +00:00
initialize chained systems (#886)
This commit is contained in:
parent
457a8bd17d
commit
4fecb899aa
2 changed files with 6 additions and 1 deletions
|
@ -49,5 +49,5 @@ pub trait System: Send + Sync + 'static {
|
|||
unsafe { self.run_unsafe(input, world, resources) }
|
||||
}
|
||||
fn run_thread_local(&mut self, world: &mut World, resources: &mut Resources);
|
||||
fn initialize(&mut self, _world: &mut World, _resources: &mut Resources) {}
|
||||
fn initialize(&mut self, _world: &mut World, _resources: &mut Resources);
|
||||
}
|
||||
|
|
|
@ -68,6 +68,11 @@ impl<SystemA: System, SystemB: System<Input = SystemA::Output>> System
|
|||
self.system_a.run_thread_local(world, resources);
|
||||
self.system_b.run_thread_local(world, resources);
|
||||
}
|
||||
|
||||
fn initialize(&mut self, world: &mut World, resources: &mut Resources) {
|
||||
self.system_a.initialize(world, resources);
|
||||
self.system_b.initialize(world, resources);
|
||||
}
|
||||
}
|
||||
|
||||
pub trait IntoChainSystem<AParams, BParams, IntoB, SystemA, SystemB>:
|
||||
|
|
Loading…
Reference in a new issue