.
This commit is contained in:
@@ -26,7 +26,6 @@ pub struct EventSystem;
|
||||
impl<'a> System<'a> for EventSystem {
|
||||
type SystemData = (
|
||||
Entities<'a>,
|
||||
WriteStorage<'a, Position>,
|
||||
WriteStorage<'a, Evented>,
|
||||
Write<'a, PersistentState>,
|
||||
Write<'a, VkProcessor>,
|
||||
@@ -35,21 +34,19 @@ impl<'a> System<'a> for EventSystem {
|
||||
|
||||
fn run(&mut self, (
|
||||
entity,
|
||||
mut position_list,
|
||||
mut evented_list,
|
||||
mut state,
|
||||
mut vk_processor,
|
||||
event_stack
|
||||
): Self::SystemData) {
|
||||
|
||||
for (position, evented) in (&mut position_list, &evented_list).join() {
|
||||
for (evented) in (&evented_list).join() {
|
||||
for event in &*event_stack {
|
||||
match event {
|
||||
TrEvent::WindowEvent { window_id, event } => {
|
||||
match event {
|
||||
TrWindowEvent::MouseInput { device_id, state, button, modifiers } => {
|
||||
if *state == ElementState::Pressed {
|
||||
position.x += 100.0;
|
||||
}
|
||||
},
|
||||
_ => {}
|
||||
|
||||
Reference in New Issue
Block a user