Trait leafwing_input_manager::Actionlike
source · [−]Expand description
A type that can be used to represent input-agnostic action representation
Actions serve as “virtual buttons”, cleanly abstracting over messy, customizable inputs in a way that can be easily consumed by your game logic.
This trait should be implemented on the A
type that you want to pass into InputManagerPlugin
Example
use leafwing_input_manager::{Actionlike, EnumIter};
#[derive(Actionlike, PartialEq, Eq, Clone, Copy, Hash, Debug, EnumIter)]
enum PlayerAction {
// Movement
Up,
Down,
Left,
Right,
// Abilities
Ability1,
Ability2,
Ability3,
Ability4,
Ultimate,
}