use crate::prelude::*; /// Menu Plugin; empty struct for Plugin impl pub(crate) struct CameraPlugin; impl Plugin for CameraPlugin { fn build(&self, app: &mut App) { app.add_systems( Update, move_editor_fly_camera.run_if(any_with_component::), ); app.add_systems( Update, rotate_editor_fly_camera.run_if(any_with_component::), ); } } #[derive(Component)] pub(crate) struct FlyCamera; /// Fly camera system for moving around like a drone /// TODO: Only if key is pressed! fn move_editor_fly_camera( mut cameras: Query<(&Camera, &mut Transform), With>, windows: Query<&Window>, primary_window: Query>, keys: Res>, time: Res