fix(examples): multiple action bindings in exmaple
This commit is contained in:
Generated
-1
@@ -428,7 +428,6 @@ dependencies = [
|
|||||||
"bevy_derive",
|
"bevy_derive",
|
||||||
"bevy_ecs",
|
"bevy_ecs",
|
||||||
"bevy_input",
|
"bevy_input",
|
||||||
"bevy_platform",
|
|
||||||
"bevy_reflect",
|
"bevy_reflect",
|
||||||
"bevy_state",
|
"bevy_state",
|
||||||
"env_logger",
|
"env_logger",
|
||||||
|
|||||||
Regular → Executable
+16
-9
@@ -86,6 +86,10 @@ fn main() {
|
|||||||
KeyCode::KeyA,
|
KeyCode::KeyA,
|
||||||
)))
|
)))
|
||||||
.with_condition(BindingCondition::InGameState(MyGameState::InGame)),
|
.with_condition(BindingCondition::InGameState(MyGameState::InGame)),
|
||||||
|
Binding::new(ButtonCombination::Single(InputType::Keyboard(
|
||||||
|
KeyCode::KeyH,
|
||||||
|
)))
|
||||||
|
.with_condition(BindingCondition::InGameState(MyGameState::InGame)),
|
||||||
]))
|
]))
|
||||||
.with_activation_options(
|
.with_activation_options(
|
||||||
ActivationOptions::new(ActivationMode::Tap, OptionsMode::Immutable).with_delay(0.05),
|
ActivationOptions::new(ActivationMode::Tap, OptionsMode::Immutable).with_delay(0.05),
|
||||||
@@ -94,21 +98,24 @@ fn main() {
|
|||||||
// the rest will be simplified
|
// the rest will be simplified
|
||||||
.with(
|
.with(
|
||||||
MyAction::Back,
|
MyAction::Back,
|
||||||
BindingConfig::from_vec(vec![Binding::from_single(InputType::Keyboard(
|
BindingConfig::from_vec(vec![
|
||||||
KeyCode::KeyS,
|
Binding::from_single(InputType::Keyboard(KeyCode::KeyS)),
|
||||||
))]),
|
Binding::from_single(InputType::Keyboard(KeyCode::KeyJ)),
|
||||||
|
]),
|
||||||
)
|
)
|
||||||
.with(
|
.with(
|
||||||
MyAction::Forward,
|
MyAction::Forward,
|
||||||
BindingConfig::from_vec(vec![Binding::from_single(InputType::Keyboard(
|
BindingConfig::from_vec(vec![
|
||||||
KeyCode::KeyW,
|
Binding::from_single(InputType::Keyboard(KeyCode::KeyW)),
|
||||||
))]),
|
Binding::from_single(InputType::Keyboard(KeyCode::KeyK)),
|
||||||
|
]),
|
||||||
)
|
)
|
||||||
.with(
|
.with(
|
||||||
MyAction::Right,
|
MyAction::Right,
|
||||||
BindingConfig::from_vec(vec![Binding::from_single(InputType::Keyboard(
|
BindingConfig::from_vec(vec![
|
||||||
KeyCode::KeyD,
|
Binding::from_single(InputType::Keyboard(KeyCode::KeyD)),
|
||||||
))]),
|
Binding::from_single(InputType::Keyboard(KeyCode::KeyL)),
|
||||||
|
]),
|
||||||
)
|
)
|
||||||
.with(
|
.with(
|
||||||
MyAction::Up,
|
MyAction::Up,
|
||||||
|
|||||||
Reference in New Issue
Block a user