generated from 2ndbeam/bevy-template
ui: Unfinished item rotating
This commit is contained in:
parent
55cbd39172
commit
55c4e3a1d1
3 changed files with 77 additions and 4 deletions
18
src/lib.rs
18
src/lib.rs
|
|
@ -20,6 +20,11 @@ pub enum InputAction {
|
|||
Interact,
|
||||
}
|
||||
|
||||
#[derive(Actionlike, PartialEq, Eq, Hash, Debug, Clone, Reflect, Serialize, Deserialize)]
|
||||
pub enum UiAction {
|
||||
Rotate,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, Default, States)]
|
||||
pub enum GameState {
|
||||
#[default]
|
||||
|
|
@ -29,14 +34,21 @@ pub enum GameState {
|
|||
|
||||
impl InputAction {
|
||||
pub fn default_input_map() -> InputMap<Self> {
|
||||
let input_map = InputMap::default()
|
||||
InputMap::default()
|
||||
.with_axis(Self::Move, VirtualAxis::ad())
|
||||
.with_axis(Self::Move, GamepadAxis::LeftStickX)
|
||||
.with(Self::ToggleInventory, KeyCode::KeyI)
|
||||
.with(Self::ToggleInventory, GamepadButton::Select)
|
||||
.with(Self::Interact, KeyCode::KeyE)
|
||||
.with(Self::Interact, GamepadButton::East);
|
||||
input_map
|
||||
.with(Self::Interact, GamepadButton::East)
|
||||
}
|
||||
}
|
||||
|
||||
impl UiAction {
|
||||
pub fn default_input_map() -> InputMap<Self> {
|
||||
InputMap::default()
|
||||
.with(Self::Rotate, KeyCode::KeyR)
|
||||
.with(Self::Rotate, GamepadButton::West)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue