Skip to content

Commit ee3b987

Browse files
committed
Added an Inspector toggle so that new behaviour is optional, default is original (OS) behaviour.
1 parent e16cea2 commit ee3b987

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Assets/HoloToolkit/Input/Scripts/Focus/SimpleSinglePointerSelector.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,12 @@ public class SimpleSinglePointerSelector : MonoBehaviour, ISourceStateHandler, I
2121
[Tooltip("The cursor, if any, which should follow the selected pointer.")]
2222
public Cursor Cursor;
2323

24-
[Tooltip("True to search for a cursor if one isn't explicitly set.")]
24+
[Tooltip("If true, search for a cursor if one isn't explicitly set.")]
2525
public bool SearchForCursorIfUnset = true;
2626

27+
[Tooltip("If true, always select the best pointer available (OS behaviour does not autoselect).")]
28+
public bool AutoselectBestAvailable = false;
29+
2730
#endregion
2831

2932
#region Data
@@ -73,7 +76,7 @@ private void OnDisable()
7376
void ISourceStateHandler.OnSourceDetected(SourceStateEventData eventData)
7477
{
7578
// If a pointing controller just became available, set it as primary.
76-
if (SupportsPointingRay(eventData))
79+
if (AutoselectBestAvailable && SupportsPointingRay(eventData))
7780
{
7881
ConnectBestAvailablePointer();
7982
}

0 commit comments

Comments
 (0)