Closed
Description
Bevy version
97d8e4e
Operating system & version
Arch Linux Plasma 5.22.1
What you did
use bevy::prelude::*;
fn main() {
App::build()
.add_plugins(DefaultPlugins)
.add_startup_system(setup.system())
.add_system(listen.system())
.run();
}
fn listen(query: Query<&Interaction, (Changed<Interaction>, With<Button>)>) {
for interaction in query.iter() {
println!("{:?}", interaction);
}
}
fn setup(mut commands: Commands, mut materials: ResMut<Assets<ColorMaterial>>) {
commands.spawn_bundle(UiCameraBundle::default());
commands
.spawn_bundle(ButtonBundle {
style: Style {
size: Size::new(Val::Percent(50.0), Val::Percent(50.0)),
..Default::default()
},
material: materials.add(Color::BLUE.into()),
..Default::default()
})
.with_children(|parent| {
parent.spawn_bundle(NodeBundle {
style: Style {
size: Size::new(Val::Percent(50.0), Val::Percent(50.0)),
..Default::default()
},
material: materials.add(Color::GREEN.into()),
..Default::default()
});
});
}
What you expected to happen
Click the child node also emits parent button interaction change.
What actually happened
Click the child node and nothing happend to the parent button.
Additional information
Their documents were all blank!!!
😱😱😱