From 71881cfffc9ca9f5375d2436c17dc1716844def8 Mon Sep 17 00:00:00 2001 From: yasirkula Date: Sun, 20 Mar 2022 13:07:28 +0300 Subject: [PATCH] - Input providers reset their values on disable (e.g. if a button is 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 --- Plugins/SimpleInput/Scripts/AxisInputs/SteeringWheel.cs | 4 ++++ Plugins/SimpleInput/Scripts/Core/BaseInput.cs | 1 + package.json | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Plugins/SimpleInput/Scripts/AxisInputs/SteeringWheel.cs b/Plugins/SimpleInput/Scripts/AxisInputs/SteeringWheel.cs index 8dcbe81..9ed40d1 100644 --- a/Plugins/SimpleInput/Scripts/AxisInputs/SteeringWheel.cs +++ b/Plugins/SimpleInput/Scripts/AxisInputs/SteeringWheel.cs @@ -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; } diff --git a/Plugins/SimpleInput/Scripts/Core/BaseInput.cs b/Plugins/SimpleInput/Scripts/Core/BaseInput.cs index 5df5226..fb77807 100644 --- a/Plugins/SimpleInput/Scripts/Core/BaseInput.cs +++ b/Plugins/SimpleInput/Scripts/Core/BaseInput.cs @@ -61,6 +61,7 @@ public void StopTracking() if( IsKeyValid() ) UnregisterInput(); + ResetValue(); isTracking = false; } } diff --git a/package.json b/package.json index 0f9ac85..0c7e974 100644 --- a/package.json +++ b/package.json @@ -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",