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.1/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(IXRHover
Declaration
public bool canProcess { get; }
Property Value
Type | Description |
---|---|
bool |
Remarks
It's recommended to return is
screenTouchCountInput
The input used to read the screen touch count value.
Declaration
public XRInputValueReader<int> screenTouchCountInput { get; set; }
Property Value
Type | Description |
---|---|
XRInput |
See Also
Methods
OnDisable()
See Mono
Declaration
protected void OnDisable()
OnEnable()
See Mono
Declaration
protected void OnEnable()
Process(IXRHoverInteractor, IXRHoverInteractable)
Called by the host object (XRInteraction
Declaration
public bool Process(IXRHoverInteractor interactor, IXRHoverInteractable interactable)
Parameters
Type | Name | Description |
---|---|---|
IXRHover |
interactor | The Interactor to validate the hover interaction. |
IXRHover |
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. |