Class XRSelectFilterDelegate
A select filter that forwards its processing to a delegate (delegateToProcess). Useful to create custom filters by code without needing to create new classes.
Implements
Inherited Members
Namespace: UnityEngine.XR.Interaction.Toolkit.Filtering
Assembly: Unity.XR.Interaction.Toolkit.dll
Syntax
public sealed class XRSelectFilterDelegate : IXRSelectFilter
Constructors
XRSelectFilterDelegate(Func<IXRSelectInteractor, IXRSelectInteractable, bool>)
Creates a new select filter delegate.
Declaration
public XRSelectFilterDelegate(Func<IXRSelectInteractor, IXRSelectInteractable, bool> delegateToProcess)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<IXRSelectInteractor, IXRSelectInteractable, bool> | delegateToProcess | The delegate to be invoked when processing this filter. |
See Also
Properties
canProcess
Whether this select filter can process interactions. Select filters that can process interactions receive calls to Process(IXRSelectInteractor, IXRSelectInteractable), select 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
delegateToProcess
The delegate to be invoked when processing this filter.
Declaration
public Func<IXRSelectInteractor, IXRSelectInteractable, bool> delegateToProcess { get; set; }
Property Value
| Type | Description |
|---|---|
| Func<IXRSelectInteractor, IXRSelectInteractable, bool> |
See Also
Methods
Process(IXRSelectInteractor, IXRSelectInteractable)
Called by the host object (XRInteractionManager, XRBaseInteractor or XRBaseInteractable) to verify if the select interaction between the given Interactor and Interactable can be performed.
Declaration
public bool Process(IXRSelectInteractor interactor, IXRSelectInteractable interactable)
Parameters
| Type | Name | Description |
|---|---|---|
| IXRSelectInteractor | interactor | The Interactor to validate the select interaction. |
| IXRSelectInteractable | interactable | The Interactable to validate the select interaction. |
Returns
| Type | Description |
|---|---|
| bool | Returns true when the given Interactor can select the given Interactable. Otherwise, returns false. |