Physics Support #8
1 changed files with 8 additions and 3 deletions
|
|
@ -4,17 +4,22 @@ use raidillon_core::scene::Scene;
|
|||
use raidillon_ecs::components::CameraMode;
|
||||
use raidillon_engine::{EngineResources, InputState};
|
||||
use raidillon_engine::system::System;
|
||||
use raidillon_platform::Camera;
|
||||
use raidillon_platform::{Camera, PlatformContext};
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct KeybindsSystem;
|
||||
pub struct KeybindsSystem {
|
||||
camera_toggle_held: bool,
|
||||
}
|
||||
|
||||
impl System for KeybindsSystem {
|
||||
fn fixed_update(&mut self, res: &mut EngineResources, scene: &mut Scene) {
|
||||
let input = res.get::<InputState>().unwrap();
|
||||
|
||||
if input.key_held(KeyCode::F5) {
|
||||
if self.camera_toggle_held { return }
|
||||
self.toggle_camera_mode(scene);
|
||||
self.camera_toggle_held = true;
|
||||
} else {
|
||||
self.camera_toggle_held = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue