Simplify working with controls (#27)
This commit is contained in:
@@ -31,9 +31,9 @@ pub struct ControlState {
|
||||
}
|
||||
|
||||
#[derive(Resource, Debug, Default)]
|
||||
pub struct Controls {
|
||||
pub keyboard_state: ControlState,
|
||||
pub gamepad_state: Option<ControlState>,
|
||||
struct Controls {
|
||||
keyboard_state: ControlState,
|
||||
gamepad_state: Option<ControlState>,
|
||||
}
|
||||
|
||||
#[derive(Event)]
|
||||
@@ -44,6 +44,7 @@ pub struct SelectedController(ControllerSet);
|
||||
|
||||
pub fn plugin(app: &mut App) {
|
||||
app.init_resource::<SelectedController>();
|
||||
app.init_resource::<ControlState>();
|
||||
|
||||
app.add_plugins(controls::plugin);
|
||||
app.add_plugins(controller_common::plugin);
|
||||
|
||||
Reference in New Issue
Block a user