Skip to content

Commit

Permalink
- Input providers reset their values on disable (e.g. if a button is …
Browse files Browse the repository at this point in the history
…deactivated while it's held, reactivating that button won't cause that button to still simulate the pressed state)

- Steering wheel resets its rotation on disable
  • Loading branch information
yasirkula committed Mar 20, 2022
1 parent 875316f commit 71881cf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Plugins/SimpleInput/Scripts/AxisInputs/SteeringWheel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ private void OnEnable()

private void OnDisable()
{
wheelBeingHeld = false;
wheelAngle = wheelPrevAngle = m_value = 0f;
wheelTR.localEulerAngles = Vector3.zero;

axis.StopTracking();
SimpleInput.OnUpdate -= OnUpdate;
}
Expand Down
1 change: 1 addition & 0 deletions Plugins/SimpleInput/Scripts/Core/BaseInput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ public void StopTracking()
if( IsKeyValid() )
UnregisterInput();

ResetValue();
isTracking = false;
}
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "com.yasirkula.simpleinput",
"displayName": "Simple Input System",
"version": "1.1.6",
"version": "1.1.7",
"documentationUrl": "https://github.com/yasirkula/UnitySimpleInput",
"changelogUrl": "https://github.com/yasirkula/UnitySimpleInput/releases",
"licensesUrl": "https://github.com/yasirkula/UnitySimpleInput/blob/master/LICENSE.txt",
Expand Down

0 comments on commit 71881cf

Please sign in to comment.