pub fn mouse_axis_system(
    mut state: Local<MouseMovementState>,
    mut mouse_axis: ResMut<Axis<Mouse>>,
    mouse_movement_events: Res<Events<MouseMotion>>,
) {
    for event in state
        .mouse_movement_event_reader
        .iter(&mouse_movement_events)
    {
        mouse_axis.add(Mouse::Horizontal, event.delta.x());
        mouse_axis.add(Mouse::Vertical, event.delta.y());
    }
}
/// Updates the Axis<Mouse::Horizontal> and Axis<Mouse::Vertical> with raw data
/// Can be different on other platforms
/// Should be used for in-game movement with mouse
Updates the Axis and Axis with raw data
Can be different on other platforms
Should be used for in-game movement with mouse
Updates the Axis and Axis with raw data Can be different on other platforms Should be used for in - game movement with mouse
pub fn mouse_axis_system(
    mut state: Local<MouseMovementState>,
    mut mouse_axis: ResMut<Axis<Mouse>>,
    mouse_movement_events: Res<Events<MouseMotion>>,
) {
    for event in state
        .mouse_movement_event_reader
        .iter(&mouse_movement_events)
    {
        mouse_axis.add(Mouse::Horizontal, event.delta.x());
        mouse_axis.add(Mouse::Vertical, event.delta.y());
    }
}
pub fn mouse_axis_system ( mut state : Local < MouseMovementState > , mut mouse_axis : ResMut < Axis < Mouse > > , mouse_movement_events : Res < Events < MouseMotion > > , ) { for event in state . mouse_movement_event_reader . iter ( & mouse_movement_events ) { mouse_axis . add ( Mouse :: Horizontal , event . delta . x ( ) ) ; mouse_axis . add ( Mouse :: Vertical , event . delta . y ( ) ) ; } }
Updates the Axis<Mouse::Horizontal> and Axis<Mouse::Vertical> with raw data
Can be different on other platforms
Should be used for in-game movement with mouse
Updates the Axis<Mouse :: Horizontal > and Axis<Mouse :: Vertical > with raw data Can be different on other platforms Should be used for in - game movement with mouse
state
Local<MouseMovementState>
mouse_axis
ResMut<Axis<Mouse>>
mouse_movement_events
Res<Events<MouseMotion>>