Class XRGazeAssistance
Allow specified ray interactors to fallback to eye-gaze when they are off screen or pointing off screen. This component enables split interaction functionality to allow the user to aim with eye gaze and select with a controller.
Implements
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit
Assembly: solution.dll
Syntax
[DisallowMultipleComponent]
[AddComponentMenu("XR/XR Gaze Assistance", 11)]
[HelpURL("https://docs.unity.cn/Packages/com.unity.xr.interaction.toolkit@3.0/api/UnityEngine.XR.Interaction.Toolkit.XRGazeAssistance.html")]
[DefaultExecutionOrder(-29980)]
public class XRGazeAssistance : MonoBehaviour, IXRAimAssist
Properties
| Name | Description |
|---|---|
| aimAssistMaxSpeedPercent | How much additional speed a projectile can receive from aim assistance, as a percentage. |
| aimAssistPercent | How much of the corrected aim velocity to use, as a percentage. |
| aimAssistRequiredAngle | How far projectiles can aim outside of eye gaze and still be considered for aim assist. |
| aimAssistRequiredSpeed | How fast a projectile must be moving to be considered for aim assist. |
| fallbackDivergence | How far an interactor must point away from the user's view area before eye gaze will be used instead. |
| gazeInteractor | Eye data source used as fallback data and to determine if fallback data should be used. |
| hideCursorWithNoActiveRays | If the eye reticle should be hidden when all interactors are using their original data. |
| rayInteractors | Interactors that can fall back to gaze data. |
Methods
| Name | Description |
|---|---|
| GetAssistedVelocity(in Vector3, in Vector3, float) | Takes a projectile's velocity and adjusts it to more closely hit a given target. |
| GetAssistedVelocity(in Vector3, in Vector3, float, float) | Takes a projectile's velocity and adjusts it to more closely hit a given target. |
| LateUpdate() | See MonoBehaviour. |
| OnDisable() | See MonoBehaviour. |
| OnEnable() | See MonoBehaviour. |
| Start() | See MonoBehaviour. |
| Update() | See MonoBehaviour. |