-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Closed
Labels
C-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorS-Needs-TriageThis issue needs to be labelledThis issue needs to be labelled
Description
Bevy version
0.9.1
What you did
The use case: I want to have a uniform which is created based on 2 separate sets of extracted data. I'm bound on one side by the Extract stage where the extraction takes place, and the Prepare stage, where the instantiated uniform is written to the buffer via UniformComponentPlugin.
There is no stage between them (adding a stage results in the system not running).
Ordering systems within one stage doesn't let the later systems see the result of the earlier. See the code below:
use bevy::prelude::*;
use bevy::render::{RenderApp, RenderStage};
fn main() {
let mut app = App::new();
if let Ok(render_app) = app.get_sub_app_mut(RenderApp) {
render_app
.add_system_to_stage(RenderStage::Prepare, spawner_system)
.add_system_to_stage(RenderStage::Prepare, looker.after(spawner_system));
}
app.run();
}
#[derive(Component, Debug)]
struct MyUniform;
fn spawner_system(mut commands: Commands) {
commands.spawn(MyUniform);
}
fn looker(query: Query<(Entity, &MyUniform)>) {
for (e, u) in query.iter() {
dbg!(e, u);
}
}
What went wrong
Expected: something is printed, i.e. spawned etities are available in the next stage which is explicitly serialized.
Actual: nothing is printed. Entities available in the next stage (not illustrated here).
Metadata
Metadata
Assignees
Labels
C-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorS-Needs-TriageThis issue needs to be labelledThis issue needs to be labelled