Skip to content

Commit

Permalink
Make use of Mouse Scroll for gun pitch handling
Browse files Browse the repository at this point in the history
  • Loading branch information
DerpyNewbie committed Aug 23, 2024
1 parent fb0657a commit c9a278b
Showing 1 changed file with 3 additions and 20 deletions.
23 changes: 3 additions & 20 deletions Packages/org.centurioncc.system/Runtime/Gun/Gun.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1126,27 +1126,10 @@ protected void Internal_HandleDesktopInputs()
FireMode = GunUtility.CycleFireMode(FireMode, AvailableFireModes);
}

if (Input.GetKeyDown(KeyCode.LeftShift))
var scrollDelta = Input.GetAxisRaw("Mouse ScrollWheel") * 80F;
if (!Mathf.Approximately(scrollDelta, 0) && !Input.GetKey(KeyCode.LeftShift))
{
CurrentMainHandlePitchOffset = 90;
RequestSerialization();
}

if (Input.GetKeyUp(KeyCode.LeftShift))
{
CurrentMainHandlePitchOffset = 0;
RequestSerialization();
}

if (Input.GetKeyDown(KeyCode.PageUp))
{
CurrentMainHandlePitchOffset -= 5;
RequestSerialization();
}

if (Input.GetKeyDown(KeyCode.PageDown))
{
CurrentMainHandlePitchOffset += 5;
CurrentMainHandlePitchOffset += scrollDelta;
RequestSerialization();
}
}
Expand Down

0 comments on commit c9a278b

Please sign in to comment.