Interface IXRSelectInteractable
An interface that represents an Interactable component which an Interactor component can select.
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit
Syntax
public interface IXRSelectInteractable : IXRInteractable
Properties
firstInteractorSelecting
(Read Only) The first interactor that selected this interactable since not being selected by any interactor. The interactor may not currently be selecting this interactable, which would be the case when it released while multiple interactors were selecting this interactable.
Declaration
IXRSelectInteractor firstInteractorSelecting { get; }
Property Value
Type | Description |
---|---|
IXRSelectInteractor |
See Also
firstSelectEntered
The event that is called only when the first Interactor begins selecting this Interactable as the sole selecting Interactor. Subsequent Interactors that begin selecting this Interactable will not cause this event to be invoked as long as any others are still selecting.
Declaration
SelectEnterEvent firstSelectEntered { get; }
Property Value
Type | Description |
---|---|
SelectEnterEvent |
Remarks
The SelectEnterEventArgs passed to each listener is only valid while the event is invoked, do not hold a reference to it.
See Also
interactorsSelecting
(Read Only) The list of Interactors currently selecting this Interactable (may by empty).
Declaration
List<IXRSelectInteractor> interactorsSelecting { get; }
Property Value
Type | Description |
---|---|
List<IXRSelectInteractor> |
Remarks
You should treat this as a read only view of the list and should not modify it. It is exposed as a List<T> rather than an IReadOnlyList<T> to avoid GC Allocations when enumerating the list.
See Also
isSelected
(Read Only) Indicates whether this interactable is currently being selected by any interactor.
Declaration
bool isSelected { get; }
Property Value
Type | Description |
---|---|
Boolean |
Remarks
In other words, returns whether interactorsSelecting contains any interactors.
interactorsSelecting.Count > 0
See Also
lastSelectExited
The event that is called only when the last remaining selecting Interactor ends selecting this Interactable.
Declaration
SelectExitEvent lastSelectExited { get; }
Property Value
Type | Description |
---|---|
SelectExitEvent |
Remarks
The SelectExitEventArgs passed to each listener is only valid while the event is invoked, do not hold a reference to it.
See Also
selectEntered
The event that is called when an Interactor begins selecting this Interactable.
Declaration
SelectEnterEvent selectEntered { get; }
Property Value
Type | Description |
---|---|
SelectEnterEvent |
Remarks
The SelectEnterEventArgs passed to each listener is only valid while the event is invoked, do not hold a reference to it.
See Also
selectExited
The event that is called when an Interactor ends selecting this Interactable.
Declaration
SelectExitEvent selectExited { get; }
Property Value
Type | Description |
---|---|
SelectExitEvent |
Remarks
The SelectExitEventArgs passed to each listener is only valid while the event is invoked, do not hold a reference to it.
See Also
selectMode
Indicates the selection policy of an Interactable.
Declaration
InteractableSelectMode selectMode { get; }
Property Value
Type | Description |
---|---|
InteractableSelectMode |
See Also
Methods
GetAttachPoseOnSelect(IXRSelectInteractor)
Gets the world position and rotation of the Attach Transform captured during the moment of selection.
Declaration
Pose GetAttachPoseOnSelect(IXRSelectInteractor interactor)
Parameters
Type | Name | Description |
---|---|---|
IXRSelectInteractor | interactor | The specific Interactor as context to get the attachment point for. |
Returns
Type | Description |
---|---|
Pose | Returns the world pose of the attachment point during the moment of selection, and otherwise the identity Pose if it was not selected by it during the current selection stack. |
See Also
GetLocalAttachPoseOnSelect(IXRSelectInteractor)
Gets the local position and rotation of the Attach Transform captured during the moment of selection.
Declaration
Pose GetLocalAttachPoseOnSelect(IXRSelectInteractor interactor)
Parameters
Type | Name | Description |
---|---|---|
IXRSelectInteractor | interactor | The specific Interactor as context to get the attachment point for. |
Returns
Type | Description |
---|---|
Pose | Returns the local pose of the attachment point during the moment of selection, and otherwise the identity Pose if it was not selected by it during the current selection stack. |
See Also
IsSelectableBy(IXRSelectInteractor)
Determines if a given Interactor can select this Interactable.
Declaration
bool IsSelectableBy(IXRSelectInteractor interactor)
Parameters
Type | Name | Description |
---|---|---|
IXRSelectInteractor | interactor | Interactor to check for a valid selection with. |
Returns
Type | Description |
---|---|
Boolean | Returns true if selection is valid this frame. Returns false if not. |
See Also
OnSelectEntered(SelectEnterEventArgs)
The XRInteractionManager calls this method when the Interactor first initiates selection of an Interactable in a second pass.
Declaration
void OnSelectEntered(SelectEnterEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
SelectEnterEventArgs | args | Event data containing the Interactor that is initiating the selection. |
Remarks
args
is only valid during this method call, do not hold a reference to it.
See Also
OnSelectEntering(SelectEnterEventArgs)
The XRInteractionManager calls this method right before the Interactor first initiates selection of an Interactable in a first pass.
Declaration
void OnSelectEntering(SelectEnterEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
SelectEnterEventArgs | args | Event data containing the Interactor that is initiating the selection. |
Remarks
args
is only valid during this method call, do not hold a reference to it.
See Also
OnSelectExited(SelectExitEventArgs)
The XRInteractionManager calls this method when the Interactor ends selection of an Interactable in a second pass.
Declaration
void OnSelectExited(SelectExitEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
SelectExitEventArgs | args | Event data containing the Interactor that is ending the selection. |
Remarks
args
is only valid during this method call, do not hold a reference to it.
See Also
OnSelectExiting(SelectExitEventArgs)
The XRInteractionManager calls this method right before the Interactor ends selection of an Interactable in a first pass.
Declaration
void OnSelectExiting(SelectExitEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
SelectExitEventArgs | args | Event data containing the Interactor that is ending the selection. |
Remarks
args
is only valid during this method call, do not hold a reference to it.