API reference
API reference
Select your platform
No SDKs available
No versions available

ControllerSelector Class

Extends MonoBehaviour
ISelector for determining whether an IController is selecting based on button presses.
This is the most common controller-based selection mechanism for all interactions.
It is possible to have multiple of these selectors monitoring the same IController, particularly when different selection mechanisms apply to different interaction types. For example, if simultaneously controlling a RayInteractor from the trigger button and GrabInteractor from the grip button, each of those interactors would have its own associated ControllerSelector specific to the relevant buttons.

Properties

Controller : IController
[Get]
The IController which dictates the state of this selector.
WhenSelected and WhenUnselected will be invoked based on the input state of this controller, as specified by the ControllerButtonUsage and RequireButtonUsages properties.
Signature
IController Oculus.Interaction.ControllerSelector.Controller
ControllerButtonUsage : ControllerButtonUsage
[Get][Set]
Flag set determining which buttons on Controller can be activated (pressed, touched, etc.) in order for this ControllerSelector to enter a "select" state.
Depending on RequireButtonUsages, one or all of these buttons may be required to select.
Signature
ControllerButtonUsage Oculus.Interaction.ControllerSelector.ControllerButtonUsage
RequireButtonUsages : ControllerSelectorLogicOperator
[Get][Set]
Determines whether selection requires all ControllerButtonUsage buttons, or merely one of them, in order to enter a selection state.
Signature
ControllerSelectorLogicOperator Oculus.Interaction.ControllerSelector.RequireButtonUsages

Events

WhenSelected : Action
Implementation of ISelector.WhenSelected; for details, please refer to the related documentation provided for that event.
Signature
Action Oculus.Interaction.ControllerSelector.WhenSelected
WhenUnselected : Action
Implementation of ISelector.WhenUnselected; for details, please refer to the related documentation provided for that event.
Signature
Action Oculus.Interaction.ControllerSelector.WhenUnselected

Protected Methods

Awake ()
Signature
virtual void Oculus.Interaction.ControllerSelector.Awake()
Returns
void
Start ()
Signature
virtual void Oculus.Interaction.ControllerSelector.Start()
Returns
void
Update ()
Signature
virtual void Oculus.Interaction.ControllerSelector.Update()
Returns
void

Methods

InjectAllControllerSelector ( controller )
Injects all required dependencies for a dynamically instantiated ControllerSelector; effectively wraps InjectController(IController).
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Signature
void Oculus.Interaction.ControllerSelector.InjectAllControllerSelector(IController controller)
Parameters
controller: IController
Returns
void
InjectController ( controller )
Sets an IController for a dynamically instantiated ControllerSelector.
This method exists to support Interaction SDK's dependency injection pattern and is not needed for typical Unity Editor-based usage.
Signature
void Oculus.Interaction.ControllerSelector.InjectController(IController controller)
Parameters
controller: IController
Returns
void

Inner Enum

ControllerSelectorLogicOperator Enum

Determines whether selection requires all ControllerButtonUsage buttons, or merely one of them, in order to enter a selection state.
Used by the RequireButtonUsages property.

Enumeration Constants

MemberValue
Any
0
All
1