mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 15:14:50 +00:00
e81142611b
# Objective Common run conditions can be very useful for quick and ergonomic changes to when a system runs. Specifically what I'd like to be able to do is ```rust use bevy::prelude::*; use bevy::input::common_conditions::input_toggle_active; fn main() { App::new() .add_plugins(DefaultPlugins) .add_plugin( bevy_inspector_egui::quick::WorldInspectorPlugin::default() .run_if(input_toggle_active(true, KeyCode::Escape) ) .run(); } ``` ## Solution - add `bevy_input::common_conditions` module with `input_toggle_active`, `input_pressed`, `input_just_pressed`, `input_just_released` ## Changelog - added common run conditions for `bevy_input` - you can now use `.add_system(jump.run_if(input_just_pressed(KeyCode::Space)))` |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |