From 567781008f2b6f9c86e3a612f12e7e2eae9073f8 Mon Sep 17 00:00:00 2001 From: Kurtis Eveleigh Date: Wed, 30 May 2018 15:26:10 -0700 Subject: [PATCH] Properly tracks sources that were detected before registered as a global listener --- Assets/HoloToolkit/Input/Scripts/Cursor/Cursor.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Assets/HoloToolkit/Input/Scripts/Cursor/Cursor.cs b/Assets/HoloToolkit/Input/Scripts/Cursor/Cursor.cs index 1ce6c83a61f..70aa332f4b6 100644 --- a/Assets/HoloToolkit/Input/Scripts/Cursor/Cursor.cs +++ b/Assets/HoloToolkit/Input/Scripts/Cursor/Cursor.cs @@ -204,6 +204,10 @@ private void OnDestroy() /// protected virtual void RegisterManagers() { + // This accounts for any input sources that were detected before we register as a global listener below. + visibleHandsCount = (uint)InputManager.Instance.DetectedInputSources.Count; + IsHandVisible = visibleHandsCount > 0; + // Register the cursor as a global listener, so that it can always get input events it cares about InputManager.Instance.AddGlobalListener(gameObject);