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
Methods
Awake()
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 |
|
Overrides
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 |
|
Overrides
GetValidTargets(List<XRBaseInteractable>)
Retrieve the list of interactables that this interactor could possibly interact with this frame. This list is sorted by priority (in this case distance).
Declaration
public override void GetValidTargets(List<XRBaseInteractable> validTargets)
Parameters
Type | Name | Description |
---|---|---|
List<XRBaseInteractable> | validTargets | Populated List of interactables that are valid for selection or hover. |
Overrides
OnTriggerEnter(Collider)
Declaration
protected void OnTriggerEnter(Collider col)
Parameters
Type | Name | Description |
---|---|---|
Collider | col |
OnTriggerExit(Collider)
Declaration
protected void OnTriggerExit(Collider col)
Parameters
Type | Name | Description |
---|---|---|
Collider | col |