Class XRSelectInteractableExtensions
Extension methods for IXRSelectInteractable.
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit.Interactables
Assembly: Unity.XR.Interaction.Toolkit.dll
Syntax
[MovedFrom("UnityEngine.XR.Interaction.Toolkit")]
public static class XRSelectInteractableExtensions
Methods
GetOldestInteractorSelecting(IXRSelectInteractable)
Gets the oldest interactor currently selecting this interactable. This is a convenience method for when the interactable does not support being selected by multiple interactors at a time.
Declaration
public static IXRSelectInteractor GetOldestInteractorSelecting(this IXRSelectInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
IXRSelectInteractable | interactable | The interactable to operate on. |
Returns
Type | Description |
---|---|
IXRSelectInteractor | Returns the oldest interactor currently selecting this interactable. |
Remarks
Equivalent to interactorsSelecting.Count > 0 ? interactorsSelecting[0] : null
See Also
IsSelectedByLeft(IXRSelectInteractable)
Gets whether the interactable is currently being selected by an interactor associated with the left hand or controller.
Declaration
public static bool IsSelectedByLeft(this IXRSelectInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
IXRSelectInteractable | interactable | The interactable to operate on. |
Returns
Type | Description |
---|---|
bool | Returns true if any interactor currently selecting this interactable has handedness of Left. |
Remarks
This method will return true even if it is not exclusively being selected by the left hand or controller. In other words, it will still return true if the interactable is also being selected by an interactor associated with the right hand or controller.
See Also
IsSelectedByRight(IXRSelectInteractable)
Gets whether the interactable is currently being selected by an interactor associated with the right hand or controller.
Declaration
public static bool IsSelectedByRight(this IXRSelectInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
IXRSelectInteractable | interactable | The interactable to operate on. |
Returns
Type | Description |
---|---|
bool | Returns true if any interactor currently selecting this interactable has handedness of Right. |
Remarks
This method will return true even if it is not exclusively being selected by the right hand or controller. In other words, it will still return true if the interactable is also being selected by an interactor associated with the left hand or controller.