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

BestSelectInteractorGroup Class

Manages a group of interactors where multiple interactors can be in the Hover state, but only the highest-priority interactor can transition to the Select state.
Other interactors are disabled until the selecting interactor unselects.
In typical setups, you will add this class to manage hand or controller interactors. The group typically includes interactors such as the PokeInteractor and GrabInteractor. By default, the priority of interactors is determined by their index in the InteractorGroup.Interactors collection, a lower index corresponds to a higher priority. However, if a custom CandidateComparer<T> is provided, it may override this default behavior based on custom comparison logic.

Properties

Determines whether any interactor should transition to the Hover state.
True if the current state is Normal and any interactor meets the criteria for hovering; otherwise, false.
Determines whether any interactor should cease to be in the Hover state.
True if the current state is Hover and any interactor meets the criteria for unhovering or no interactors are in the Hover state; otherwise, false.
Determines whether any interactor should transition to the Select state.
True if the current state is Hover and any interactor meets the criteria for selection; otherwise, false.
Determines whether the highest-priority interactor should cease being in the Select state.
True if the current state is Select and the highest-priority interactor meets the criteria for unselection; otherwise, false.
A property indicating whether there is some interaction that the conceptual "interactor" could undertake.
For typical transitive interactions (i.e., PokeInteractor, GrabInteractor, and others where the interaction is applied to some conceptual "interactable"), this indicates whether or not there is some IInteractable with which this interactor can initiate an interaction. For intransitive interactions such as Locomotion.LocomotionTurnerInteractor which do not conceptually apply the interaction to something, this property merely indicates whether or not it is possible for the intransitive interaction to take place at this time.
A property indicating whether this conceptual "interactor" is actively hovering or selecting, which for most interactions means there is an IInteractable with which the interactor is currently associated.
In general, this will be true when State returns either InteractorState.Hover or InteractorState.Select.
A property indicating whether this conceptual "interactor" is actively selecting, which for most interactions means there is an IInteractable with which the interactor is currently interacting.
This is only true if State is InteractorState.Select.
A generic metadata property used for a variety of purposes in Interaction SDK logic.
Though this property is public and canonically may contain instances of types such as RayInteractor.RayCandidateProperties, it has no formal contract and is not safe to use outside of Interaction SDK core logic.

Member Functions

Attempts to transition any suitable interactor into the Hover state.
This method iterates through interactors, transitioning the first one that meets the hover criteria into the Hover state. The group's state updates to Hover if at least one interactor transitions successfully.
Attempts to transition any interactor from the Hover state back to the Normal state.
This method iterates through interactors and transitions those that meet the unhover criteria out of the Hover state. If no interactors remain in the Hover state, the group's state is updated to InteractorState.Normal.
Selects the highest-priority interactor that is currently in the Hover state and transitions it to the Select state.
This method identifies the best candidate for selection, transitioning it to the Select state. It disables all other interactors to ensure that only the selected one is active. This method should only be called when ShouldSelect returns true, indicating that the conditions for selection are met.
Reverses the selection process, transitioning the currently selected interactor back to the Hover state.
This method should only be called when ShouldUnselect returns true, ensuring that the currently selected interactor meets the criteria to unselect. If the interactor unselects successfully, the group's state is updated to Hover.
Prepares interactors for state transitions based on current conditions and processes any necessary state changes.
Processes state transitions and interactions for interactors based on the current group state and individual interactor conditions.
Implementation of IInteractor.Enable; for details, please refer to the related documentation provided for that interface.
Implementation of IInteractor.Disable; for details, please refer to the related documentation provided for that interface.
void InjectAllInteractorGroupBestSelect
( List< IInteractor > interactors )
Did you find this page helpful?
Thumbs up icon
Thumbs down icon