docs.unity3d.com
    Show / Hide Table of Contents

    Class XRInteractionStrengthFilterDelegate

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

    Inheritance
    Object
    XRInteractionStrengthFilterDelegate
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: UnityEngine.XR.Interaction.Toolkit.Filtering
    Syntax
    public sealed class XRInteractionStrengthFilterDelegate : IXRInteractionStrengthFilter

    Constructors

    XRInteractionStrengthFilterDelegate(Func<IXRInteractor, IXRInteractable, Single, Single>)

    Creates a new interaction strength filter delegate.

    Declaration
    public XRInteractionStrengthFilterDelegate(Func<IXRInteractor, IXRInteractable, float, float> delegateToProcess)
    Parameters
    Type Name Description
    Func<IXRInteractor, IXRInteractable, Single, Single> delegateToProcess

    The delegate to be invoked when processing this filter.

    Properties

    canProcess

    Whether this interaction strength filter can process. Interaction strength filters that can process receive calls to Process(IXRInteractor, IXRInteractable, Single), interaction strength filters that cannot process do not.

    Declaration
    public bool canProcess { get; set; }
    Property Value
    Type Description
    Boolean
    Implements
    IXRInteractionStrengthFilter.canProcess
    Remarks

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

    delegateToProcess

    The delegate to be invoked when processing this filter.

    Declaration
    public Func<IXRInteractor, IXRInteractable, float, float> delegateToProcess { get; set; }
    Property Value
    Type Description
    Func<IXRInteractor, IXRInteractable, Single, Single>

    Methods

    Process(IXRInteractor, IXRInteractable, Single)

    Called by the host object (XRBaseInteractable) to calculate the interaction strength between the given Interactor and Interactable.

    Declaration
    public float Process(IXRInteractor interactor, IXRInteractable interactable, float interactionStrength)
    Parameters
    Type Name Description
    IXRInteractor interactor

    The Interactor interacting.

    IXRInteractable interactable

    The Interactable interacting with the interactor.

    Single interactionStrength

    The input interaction strength.

    Returns
    Type Description
    Single

    Returns the modified interaction strength that is the result of passing the interaction strength through the filter.

    Implements
    IXRInteractionStrengthFilter.Process(IXRInteractor, IXRInteractable, Single)

    See Also

    IXRInteractionStrengthFilter
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023