docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class XRHoverFilterDelegate

    A hover filter that forwards its processing to a delegate (delegateToProcess). Useful to create custom filters by code without needing to create new classes.

    Inheritance
    object
    XRHoverFilterDelegate
    Implements
    IXRHoverFilter
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.XR.Interaction.Toolkit.Filtering
    Assembly: Unity.XR.Interaction.Toolkit.dll
    Syntax
    public sealed class XRHoverFilterDelegate : IXRHoverFilter

    Constructors

    XRHoverFilterDelegate(Func<IXRHoverInteractor, IXRHoverInteractable, bool>)

    Creates a new hover filter delegate.

    Declaration
    public XRHoverFilterDelegate(Func<IXRHoverInteractor, IXRHoverInteractable, bool> delegateToProcess)
    Parameters
    Type Name Description
    Func<IXRHoverInteractor, IXRHoverInteractable, bool> delegateToProcess

    The delegate to be invoked when processing this filter.

    See Also
    XRSelectFilterDelegate

    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; set; }
    Property Value
    Type Description
    bool
    Remarks

    It's recommended to return isActiveAndEnabled when implementing this interface in a MonoBehaviour.

    See Also
    XRSelectFilterDelegate

    delegateToProcess

    The delegate to be invoked when processing this filter.

    Declaration
    public Func<IXRHoverInteractor, IXRHoverInteractable, bool> delegateToProcess { get; set; }
    Property Value
    Type Description
    Func<IXRHoverInteractor, IXRHoverInteractable, bool>
    See Also
    XRSelectFilterDelegate

    Methods

    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.

    See Also
    XRSelectFilterDelegate

    Implements

    IXRHoverFilter

    See Also

    XRSelectFilterDelegate
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)