Class XRDirectInteractor
Interactor used for directly interacting with interactables that are touching. This is handled via trigger volumes that update the current set of valid targets for this interactor. This component must have a collision volume that is set to be a trigger to work.
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit
Syntax
public class XRDirectInteractor : XRBaseControllerInteractor
Properties
validTargets
(Read Only) A list of Interactables that this Interactor could possibly interact with this frame.
Declaration
protected override List<XRBaseInteractable> validTargets { get; }
Property Value
Type | Description |
---|---|
List<XRBaseInteractable> |
Overrides
See Also
Methods
Awake()
See
Declaration
protected override void Awake()
Overrides
CanHover(XRBaseInteractable)
Determines if the interactable is valid for hover this frame.
Declaration
public override bool CanHover(XRBaseInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
XRBaseInteractable | interactable | Interactable to check. |
Returns
Type | Description |
---|---|
Boolean | Returns true if the interactable can be hovered over this frame. |
Overrides
See Also
CanSelect(XRBaseInteractable)
Determines if the interactable is valid for selection this frame.
Declaration
public override bool CanSelect(XRBaseInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
XRBaseInteractable | interactable | Interactable to check. |
Returns
Type | Description |
---|---|
Boolean | Returns true if the interactable can be selected this frame. |
Overrides
See Also
GetValidTargets(List<XRBaseInteractable>)
Retrieve the list of Interactables that this Interactor could possibly interact with this frame. This list is sorted by priority (with highest priority first).
Declaration
public override void GetValidTargets(List<XRBaseInteractable> targets)
Parameters
Type | Name | Description |
---|---|---|
List<XRBaseInteractable> | targets | The results list to populate with Interactables that are valid for selection or hover. |
Overrides
OnRegistered(InteractorRegisteredEventArgs)
This method is called by the Interaction Manager when this Interactor is registered with it.
Declaration
protected override void OnRegistered(InteractorRegisteredEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
InteractorRegisteredEventArgs | args | Event data containing the Interaction Manager that registered this Interactor. |
Overrides
Remarks
args
is only valid during this method call, do not hold a reference to it.
See Also
OnTriggerEnter(Collider)
See
Declaration
protected void OnTriggerEnter(Collider other)
Parameters
Type | Name | Description |
---|---|---|
Collider | other | The other |
OnTriggerExit(Collider)
See
Declaration
protected void OnTriggerExit(Collider other)
Parameters
Type | Name | Description |
---|---|---|
Collider | other | The other |
OnUnregistered(InteractorUnregisteredEventArgs)
This method is called by the Interaction Manager when this Interactor is unregistered from it.
Declaration
protected override void OnUnregistered(InteractorUnregisteredEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
InteractorUnregisteredEventArgs | args | Event data containing the Interaction Manager that unregistered this Interactor. |
Overrides
Remarks
args
is only valid during this method call, do not hold a reference to it.