Class XRGazeInteractor
Interactor used for interacting with interactables via gaze. This extends XRRayInteractor and uses the same ray cast technique to update a current set of valid targets.
Inheritance
Implements
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit
Assembly: solution.dll
Syntax
[AddComponentMenu("XR/XR Gaze Interactor", 11)]
[HelpURL("https://docs.unity.cn/Packages/com.unity.xr.interaction.toolkit@3.0/api/UnityEngine.XR.Interaction.Toolkit.XRGazeInteractor.html")]
public class XRGazeInteractor : XRRayInteractor, IXRHoverInteractor, IXRSelectInteractor, IXRTargetPriorityInteractor, IXRGroupMember, IXRInteractionStrengthInteractor, IXRActivateInteractor, IXRInteractor, IAdvancedLineRenderable, ILineRenderable, IUIHoverInteractor, IUIInteractor, IXRRayProvider, IXRScaleValueProvider
Properties
| Name | Description |
|---|---|
| clampGazeAssistanceDistanceScaling | If true, the gazeAssistanceSnapVolume scale will be clamped at gazeAssistanceDistanceScalingClampValue. |
| gazeAssistanceCalculation | Defines the way the gaze assistance calculates and sizes the assistance area. |
| gazeAssistanceColliderFixedSize | The size of the gazeAssistanceSnapVolume collider when gazeAssistanceCalculation is FixedSize. |
| gazeAssistanceColliderScale | The scale of the gazeAssistanceSnapVolume when gazeAssistanceCalculation is FixedSize or ColliderSize . |
| gazeAssistanceDistanceScaling | If true, the gazeAssistanceSnapVolume will also scale based on the distance from the XRGazeInteractor. |
| gazeAssistanceDistanceScalingClampValue | The value the assistance collider scale will be clamped to if clampGazeAssistanceDistanceScaling is true. |
| gazeAssistanceSnapVolume | The XRInteractableSnapVolume to place where this XRGazeInteractor hits a valid target for gaze assistance. If not set, Unity will create one by default. |
Methods
| Name | Description |
|---|---|
| Awake() | See MonoBehaviour. |
| GetHoverTimeToSelect(IXRInteractable) | Gets the number of seconds for which this interactor must hover over the interactable to select it if hoverToSelect is enabled. |
| GetTimeToAutoDeselect(IXRInteractable) | Gets the number of seconds for which this interactor will keep the interactable selected before automatically deselecting it. |
| PreprocessInteractor(UpdatePhase) | The XRInteractionManager or containing IXRInteractionGroup calls this method to update the Interactor before interaction events occur. Interactors should use this method to do tasks like determine their valid targets. |
| UpdateSnapVolumeInteractable(IXRInteractable) | Updates the gazeAssistanceSnapVolume based on a target interactable. |