From 105c93e012e10effbe27ca0a87953e765729e0c3 Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Sat, 2 Jan 2021 22:34:05 +0100 Subject: [PATCH] Move mouse event reader into system local variable --- src/player.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/player.rs b/src/player.rs index b15d22d..bad44e4 100644 --- a/src/player.rs +++ b/src/player.rs @@ -17,18 +17,12 @@ pub struct PlayerPlugin; impl Plugin for PlayerPlugin { fn build(&self, app: &mut AppBuilder) { app - .init_resource::() .add_system(player_movement_system.system()) .add_system(player_look_system.system()) .add_startup_system(init_player.system()); } } -#[derive(Default)] -struct State { - mouse_motion_event_reader: EventReader, -} - #[derive(Default)] struct PlayerMarker; @@ -133,12 +127,12 @@ fn movement_axis(input: &Res>, plus: KeyCode, minus: KeyCode) -> fn player_look_system( time: Res