Skip to content

Commit

Permalink
Fix virtual_dpad example (#574)
Browse files Browse the repository at this point in the history
  • Loading branch information
alice-i-cecile authored Aug 6, 2024
1 parent 30c1c1a commit a318f44
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion examples/virtual_dpad.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,22 @@ fn main() {
.run();
}

#[derive(Actionlike, PartialEq, Eq, Clone, Copy, Hash, Debug, Reflect)]
#[derive(PartialEq, Eq, Clone, Copy, Hash, Debug, Reflect)]
enum Action {
Move,
}

impl Actionlike for Action {
fn input_control_kind(&self) -> InputControlKind {
// We're using a match statement here
// because in larger projects, you will likely have
// different input control kinds for different actions
match self {
Action::Move => InputControlKind::DualAxis,
}
}
}

#[derive(Component)]
struct Player;

Expand Down

0 comments on commit a318f44

Please sign in to comment.