ISelector exposes two events. An Interactor listens to them to start and end a selection.public interface ISelector
{
event Action WhenSelected;
event Action WhenUnselected;
}
ISelector implementations, among others. Each one supplies a different way for the user to confirm a selection.| Implementation | Selection mechanism |
|---|---|
IndexPinchSelector | A hand tracking pinch between the index finger and thumb. |
ControllerSelector | A controller button press. |
ActiveStateSelector | An IActiveState becoming active, which routes active state logic into a selection. |
VirtualSelector | A Select() or Unselect() call from your own code, or a flag toggled in the Inspector. |
ISelector. Any other references an Interactor requires are configured separately.GazeInteractor targets an object by where the user looks. It does not define its own selection mechanism. It requires an ISelector to supply the confirmation step, assigned to its Selector property.GazeInteractor asserts on that property at startup, so leaving it unassigned is a setup error, not a supported configuration. The assert is marked [Conditional("UNITY_ASSERTIONS")], so it compiles out of non-development builds. The Selector property is protected. To assign a selector from your own code, call InjectSelector(ISelector).GazeInteractor with an IndexPinchSelector for hand tracking, or with a ControllerSelector for controllers. The selector determines how the user triggers the selection. A GazeInteractor also holds other required references that you configure for the input setup you are targeting.ActiveStateSelector converts into selections, see Active State.