Skip to content

Commit 4fecb89

Browse files
authored
initialize chained systems (#886)
1 parent 457a8bd commit 4fecb89

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

crates/bevy_ecs/src/system/system.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,5 @@ pub trait System: Send + Sync + 'static {
4949
unsafe { self.run_unsafe(input, world, resources) }
5050
}
5151
fn run_thread_local(&mut self, world: &mut World, resources: &mut Resources);
52-
fn initialize(&mut self, _world: &mut World, _resources: &mut Resources) {}
52+
fn initialize(&mut self, _world: &mut World, _resources: &mut Resources);
5353
}

crates/bevy_ecs/src/system/system_chaining.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,11 @@ impl<SystemA: System, SystemB: System<Input = SystemA::Output>> System
6868
self.system_a.run_thread_local(world, resources);
6969
self.system_b.run_thread_local(world, resources);
7070
}
71+
72+
fn initialize(&mut self, world: &mut World, resources: &mut Resources) {
73+
self.system_a.initialize(world, resources);
74+
self.system_b.initialize(world, resources);
75+
}
7176
}
7277

7378
pub trait IntoChainSystem<AParams, BParams, IntoB, SystemA, SystemB>:

0 commit comments

Comments
 (0)