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