From 3de4b5750276fd64bf252e154bc660948e3da06f Mon Sep 17 00:00:00 2001 From: Jibran Ibrahim Syed Date: Tue, 2 Feb 2016 10:39:49 -0600 Subject: [PATCH] Fixed Mac bug where the trigger input will go back to 0.5 if the game goes out of focus. See issue #16 --- XboxCtrlrInput/Assets/XboxCtrlrInput/XboxCtrlrInput.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/XboxCtrlrInput/Assets/XboxCtrlrInput/XboxCtrlrInput.cs b/XboxCtrlrInput/Assets/XboxCtrlrInput/XboxCtrlrInput.cs index dcab829..807076a 100644 --- a/XboxCtrlrInput/Assets/XboxCtrlrInput/XboxCtrlrInput.cs +++ b/XboxCtrlrInput/Assets/XboxCtrlrInput/XboxCtrlrInput.cs @@ -1709,6 +1709,14 @@ void OnLevelWasLoaded(int level) this.ResetTriggerTouches(); } + void OnApplicationFocus(bool isWindowInFocusNow) + { + if(!isWindowInFocusNow) + { + this.ResetTriggerTouches(); + } + } + private void ResetTriggerTouches() { this.u3dTrigger0LeftIsTouched = false;