Class TouchscreenHoverFilter
Hover filter that checks if the screen is being touched and doing a selecting gesture. Can be used with the ray interactor to prevent hover interactions when the screen is not being touched.
Implements
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit.Filtering
Assembly: Unity.XR.Interaction.Toolkit.dll
Syntax
[AddComponentMenu("XR/AR/Touchscreen Hover Filter", 11)]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@3.0/api/UnityEngine.XR.Interaction.Toolkit.Filtering.TouchscreenHoverFilter.html")]
public class TouchscreenHoverFilter : MonoBehaviour, IXRHoverFilter
Properties
canProcess
Whether this hover filter can process interactions. Hover filters that can process interactions receive calls to Process(IXRHoverInteractor, IXRHoverInteractable), hover filters that cannot process do not.
Declaration
public bool canProcess { get; }
Property Value
Type | Description |
---|---|
bool |
Remarks
It's recommended to return isActiveAndEnabled when implementing this interface in a MonoBehaviour.
screenTouchCountInput
The input used to read the screen touch count value.
Declaration
public XRInputValueReader<int> screenTouchCountInput { get; set; }
Property Value
Type | Description |
---|---|
XRInputValueReader<int> |
See Also
Methods
OnDisable()
See MonoBehaviour.
Declaration
protected void OnDisable()
OnEnable()
See MonoBehaviour.
Declaration
protected void OnEnable()
Process(IXRHoverInteractor, IXRHoverInteractable)
Called by the host object (XRInteractionManager, XRBaseInteractor or XRBaseInteractable) to verify if the hover interaction between the given Interactor and Interactable can be performed.
Declaration
public bool Process(IXRHoverInteractor interactor, IXRHoverInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
IXRHoverInteractor | interactor | The Interactor to validate the hover interaction. |
IXRHoverInteractable | interactable | The Interactable to validate the hover interaction. |
Returns
Type | Description |
---|---|
bool | Returns true when the given Interactor can hover the given Interactable. Otherwise, returns false. |