mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
96a6eee031
# Objective If the current example is used as is, the `button_pressed` system will run every update. Update the example so that it is a more ready to use for people ## Solution Rewrote most of it. Another solution would be to just minimally fix the problems ```Rust .add_systems(Startup, (count_entities, setup).chain()) ``` and ```Rust fn evaluate_callbacks(query: Query<(Entity, &Callback), With<Triggered>>, mut commands: Commands) { for (entity, callback) in query.iter() { commands.run_system(callback.0); commands.entity(entity).remove::<Triggered>(); } } ``` ## Testing - Did you test these changes? If so, how? Ran the example and pressed A / B on the keyboard --- |
||
---|---|---|
.. | ||
component_change_detection.rs | ||
component_hooks.rs | ||
computed_states.rs | ||
custom_query_param.rs | ||
custom_schedule.rs | ||
dynamic.rs | ||
ecs_guide.rs | ||
event.rs | ||
fixed_timestep.rs | ||
generic_system.rs | ||
hierarchy.rs | ||
iter_combinations.rs | ||
nondeterministic_system_order.rs | ||
one_shot_systems.rs | ||
parallel_query.rs | ||
removal_detection.rs | ||
run_conditions.rs | ||
send_and_receive_events.rs | ||
startup_system.rs | ||
state.rs | ||
sub_states.rs | ||
system_closure.rs | ||
system_param.rs | ||
system_piping.rs | ||
system_stepping.rs |