Move input_manager and camera as resource
This commit is contained in:
parent
6ba61e040e
commit
07056fc0ce
5 changed files with 72 additions and 68 deletions
|
@ -1,5 +1,9 @@
|
|||
use std::collections::HashMap;
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
sync::{Arc, RwLock},
|
||||
};
|
||||
|
||||
use bevy_ecs::resource::Resource;
|
||||
use cache::{CachedElementState, CachedMovement};
|
||||
use virtual_input::VirtualInput;
|
||||
use winit::{
|
||||
|
@ -22,6 +26,9 @@ pub struct InputManager {
|
|||
virtual_input: VirtualInput,
|
||||
}
|
||||
|
||||
#[derive(Resource)]
|
||||
pub struct InputManagerResource(pub Arc<RwLock<InputManager>>);
|
||||
|
||||
impl std::fmt::Debug for InputManager {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
f.debug_struct("InputManager")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue