docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class XRInteractorAffordanceStateProvider

    State Machine component that derives an interaction affordance state from an associated IXRInteractor.

    Inheritance
    object
    Object
    Component
    Behaviour
    MonoBehaviour
    BaseAffordanceStateProvider
    XRInteractorAffordanceStateProvider
    Inherited Members
    BaseAffordanceStateProvider.transitionDuration
    BaseAffordanceStateProvider.isCurrentlyTransitioning
    BaseAffordanceStateProvider.currentAffordanceStateData
    BaseAffordanceStateProvider.OnValidate()
    BaseAffordanceStateProvider.OnEnable()
    BaseAffordanceStateProvider.OnDisable()
    BaseAffordanceStateProvider.Update()
    BaseAffordanceStateProvider.AddBinding(IEventBinding)
    BaseAffordanceStateProvider.UpdateAffordanceState(AffordanceStateData)
    BaseAffordanceStateProvider.RegisterAffordanceReceiver(IAffordanceStateReceiver)
    BaseAffordanceStateProvider.UnregisterAffordanceReceiver(IAffordanceStateReceiver)
    MonoBehaviour.IsInvoking()
    MonoBehaviour.CancelInvoke()
    MonoBehaviour.Invoke(string, float)
    MonoBehaviour.InvokeRepeating(string, float, float)
    MonoBehaviour.CancelInvoke(string)
    MonoBehaviour.IsInvoking(string)
    MonoBehaviour.StartCoroutine(string)
    MonoBehaviour.StartCoroutine(string, object)
    MonoBehaviour.StartCoroutine(IEnumerator)
    MonoBehaviour.StopCoroutine(IEnumerator)
    MonoBehaviour.StopCoroutine(Coroutine)
    MonoBehaviour.StopCoroutine(string)
    MonoBehaviour.StopAllCoroutines()
    MonoBehaviour.print(object)
    MonoBehaviour.useGUILayout
    MonoBehaviour.runInEditMode
    Behaviour.enabled
    Behaviour.isActiveAndEnabled
    Component.GetComponent(Type)
    Component.GetComponent<T>()
    Component.TryGetComponent(Type, out Component)
    Component.TryGetComponent<T>(out T)
    Component.GetComponent(string)
    Component.GetComponentInChildren(Type, bool)
    Component.GetComponentInChildren(Type)
    Component.GetComponentInChildren<T>(bool)
    Component.GetComponentInChildren<T>()
    Component.GetComponentsInChildren(Type, bool)
    Component.GetComponentsInChildren(Type)
    Component.GetComponentsInChildren<T>(bool)
    Component.GetComponentsInChildren<T>(bool, List<T>)
    Component.GetComponentsInChildren<T>()
    Component.GetComponentsInChildren<T>(List<T>)
    Component.GetComponentInParent(Type, bool)
    Component.GetComponentInParent(Type)
    Component.GetComponentInParent<T>(bool)
    Component.GetComponentInParent<T>()
    Component.GetComponentsInParent(Type, bool)
    Component.GetComponentsInParent(Type)
    Component.GetComponentsInParent<T>(bool)
    Component.GetComponentsInParent<T>(bool, List<T>)
    Component.GetComponentsInParent<T>()
    Component.GetComponents(Type)
    Component.GetComponents(Type, List<Component>)
    Component.GetComponents<T>(List<T>)
    Component.GetComponents<T>()
    Component.CompareTag(string)
    Component.SendMessageUpwards(string, object, SendMessageOptions)
    Component.SendMessageUpwards(string, object)
    Component.SendMessageUpwards(string)
    Component.SendMessageUpwards(string, SendMessageOptions)
    Component.SendMessage(string, object)
    Component.SendMessage(string)
    Component.SendMessage(string, object, SendMessageOptions)
    Component.SendMessage(string, SendMessageOptions)
    Component.BroadcastMessage(string, object, SendMessageOptions)
    Component.BroadcastMessage(string, object)
    Component.BroadcastMessage(string)
    Component.BroadcastMessage(string, SendMessageOptions)
    Component.transform
    Component.gameObject
    Component.tag
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(object)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, bool)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, bool)
    Object.FindObjectsByType(Type, FindObjectsSortMode)
    Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode)
    Object.DontDestroyOnLoad(Object)
    Object.FindObjectsOfType<T>()
    Object.FindObjectsByType<T>(FindObjectsSortMode)
    Object.FindObjectsOfType<T>(bool)
    Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
    Object.FindObjectOfType<T>()
    Object.FindObjectOfType<T>(bool)
    Object.FindFirstObjectByType<T>()
    Object.FindAnyObjectByType<T>()
    Object.FindFirstObjectByType<T>(FindObjectsInactive)
    Object.FindAnyObjectByType<T>(FindObjectsInactive)
    Object.FindObjectOfType(Type)
    Object.FindFirstObjectByType(Type)
    Object.FindAnyObjectByType(Type)
    Object.FindObjectOfType(Type, bool)
    Object.FindFirstObjectByType(Type, FindObjectsInactive)
    Object.FindAnyObjectByType(Type, FindObjectsInactive)
    Object.ToString()
    Object.name
    Object.hideFlags
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.XR.Interaction.Toolkit.AffordanceSystem.State
    Assembly: Unity.XR.Interaction.Toolkit.dll
    Syntax
    [AddComponentMenu("Affordance System/XR Interactor Affordance State Provider", 11)]
    [HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@2.5/api/UnityEngine.XR.Interaction.Toolkit.AffordanceSystem.State.XRInteractorAffordanceStateProvider.html")]
    [DisallowMultipleComponent]
    public class XRInteractorAffordanceStateProvider : BaseAffordanceStateProvider

    Properties

    activateClickAnimationMode

    Condition to trigger click animation for activated interaction events.

    Declaration
    public XRInteractorAffordanceStateProvider.ActivateClickAnimationMode activateClickAnimationMode { get; set; }
    Property Value
    Type Description
    XRInteractorAffordanceStateProvider.ActivateClickAnimationMode

    clickAnimationCurve

    Animation curve reference for click animation events.

    Declaration
    public AnimationCurveDatumProperty clickAnimationCurve { get; set; }
    Property Value
    Type Description
    AnimationCurveDatumProperty

    clickAnimationDuration

    Duration of click animations for selected and activated events.

    Declaration
    public float clickAnimationDuration { get; set; }
    Property Value
    Type Description
    float

    hasUIHover

    Is the interactor overlapping a UI Canvas and hitting a UI raycast target.

    Declaration
    protected virtual bool hasUIHover { get; }
    Property Value
    Type Description
    bool

    hasUISelection

    Whether the interactor is hovering UI and the interactor select action is pressed.

    Declaration
    protected virtual bool hasUISelection { get; }
    Property Value
    Type Description
    bool

    hasXRHover

    Is attached interactor in a hovered state.

    Declaration
    protected virtual bool hasXRHover { get; }
    Property Value
    Type Description
    bool

    hasXRSelection

    Is attached interactor in a selected state.

    Declaration
    protected virtual bool hasXRSelection { get; }
    Property Value
    Type Description
    bool

    ignoreActivateEvents

    When activate events are registered and this is true, the state will fallback to idle or disabled.

    Declaration
    public bool ignoreActivateEvents { get; set; }
    Property Value
    Type Description
    bool

    ignoreHoverEvents

    When hover events are registered and this is true, the state will fallback to idle or disabled.

    Declaration
    public bool ignoreHoverEvents { get; set; }
    Property Value
    Type Description
    bool

    ignoreSelectEvents

    When select events are registered and this is true, the state will fallback to idle or disabled.

    Declaration
    public bool ignoreSelectEvents { get; set; }
    Property Value
    Type Description
    bool

    ignoreUGUIHover

    With the XR Ray Interactor it is possible to trigger select events from the ray interactor overlapping with a canvas.

    Declaration
    public bool ignoreUGUIHover { get; set; }
    Property Value
    Type Description
    bool

    ignoreUGUISelect

    With the XR Ray Interactor it is possible to trigger select events from the ray interactor overlapping with a canvas and triggering the select input.

    Declaration
    public bool ignoreUGUISelect { get; set; }
    Property Value
    Type Description
    bool

    ignoreXRInteractionEvents

    This option will prevent Hover, Select, and Activate events from being triggered when they come from the XR Interaction Manager. UGUI hover and select events will still come through.

    Declaration
    public bool ignoreXRInteractionEvents { get; set; }
    Property Value
    Type Description
    bool

    interactorSource

    The interactor component that drives the affordance states. If null, Unity will try and find an interactor component attached.

    Declaration
    public Object interactorSource { get; set; }
    Property Value
    Type Description
    Object

    isActivated

    Is attached interactable in an activated state.

    Declaration
    protected virtual bool isActivated { get; }
    Property Value
    Type Description
    bool

    isBlockedByGroup

    Check if interactor is blocked by interaction within its group.

    Declaration
    protected virtual bool isBlockedByGroup { get; }
    Property Value
    Type Description
    bool

    isRegistered

    Is attached interactor in a registered state.

    Declaration
    protected virtual bool isRegistered { get; }
    Property Value
    Type Description
    bool

    selectClickAnimationMode

    Condition to trigger click animation for Selected interaction events.

    Declaration
    public XRInteractorAffordanceStateProvider.SelectClickAnimationMode selectClickAnimationMode { get; set; }
    Property Value
    Type Description
    XRInteractorAffordanceStateProvider.SelectClickAnimationMode

    Methods

    ActivatedClickBehavior()

    Handles starting the activated click animation coroutine. Stops any previously started coroutine.

    Declaration
    protected virtual void ActivatedClickBehavior()

    Awake()

    See MonoBehaviour.

    Declaration
    protected void Awake()

    BindToProviders()

    Inform all registered receivers of the current affordance state data and subscribe to changes of the affordance state.

    Declaration
    protected override void BindToProviders()
    Overrides
    BaseAffordanceStateProvider.BindToProviders()
    Remarks

    This method is automatically called by Unity when this component is enabled.

    See Also
    OnAffordanceStateUpdated(AffordanceStateData, AffordanceStateData)

    ClearBindings()

    Triggers unbind action on all bindings and destroys all stored binding actions, as well as clears the group of all registered bindings.

    Declaration
    protected override void ClearBindings()
    Overrides
    BaseAffordanceStateProvider.ClearBindings()
    Remarks

    This method is automatically called by Unity when this component is disabled.

    ClickAnimation(byte, float, Action)

    Click animation coroutine that plays over a set period of time, transitioning between the lower and upper bounds of a given affordance state.

    Declaration
    protected virtual IEnumerator ClickAnimation(byte targetStateIndex, float duration, Action onComplete = null)
    Parameters
    Type Name Description
    byte targetStateIndex

    Target animation state with bounds which to transition between.

    float duration

    Duration of the animation.

    Action onComplete

    OnComplete callback action.

    Returns
    Type Description
    IEnumerator

    Enumerator used to play as a coroutine.

    GenerateNewAffordanceState()

    Evaluates the state of the current interactor to generate a corresponding AffordanceStateData.

    Declaration
    protected virtual AffordanceStateData GenerateNewAffordanceState()
    Returns
    Type Description
    AffordanceStateData

    Newly generated affordance state corresponding to the interactor state.

    OnHoverEntered(HoverEnterEventArgs)

    Callback triggered by IXRHoverInteractor when this interactor begins hovering. Refreshes the affordance state.

    Declaration
    protected virtual void OnHoverEntered(HoverEnterEventArgs args)
    Parameters
    Type Name Description
    HoverEnterEventArgs args

    HoverEnterEventArgs callback args.

    See Also
    hoverEntered

    OnHoverExited(HoverExitEventArgs)

    Callback triggered by IXRHoverInteractor when this interactor is no longer hovering. Refreshes the affordance state.

    Declaration
    protected virtual void OnHoverExited(HoverExitEventArgs args)
    Parameters
    Type Name Description
    HoverExitEventArgs args

    HoverExitEventArgs callback args.

    See Also
    hoverExited

    OnLargestInteractionStrengthChanged(float)

    Callback triggered by IXRInteractionStrengthInteractor when the largest interaction strength of this interactor changes. Refreshes the affordance state.

    Declaration
    protected virtual void OnLargestInteractionStrengthChanged(float value)
    Parameters
    Type Name Description
    float value

    The new largest interaction strength value of this interactor.

    OnRegistered(InteractorRegisteredEventArgs)

    Callback triggered when the interactor is registered with the XRInteractionManager. Sets the internal isRegistered flag to true and refreshes the affordance state.

    Declaration
    protected virtual void OnRegistered(InteractorRegisteredEventArgs args)
    Parameters
    Type Name Description
    InteractorRegisteredEventArgs args

    InteractorRegisteredEventArgs callback args.

    OnSelectEntered(SelectEnterEventArgs)

    Callback triggered by IXRSelectInteractor when the first interactor begins selecting. Refreshes the affordance state.

    Declaration
    protected virtual void OnSelectEntered(SelectEnterEventArgs args)
    Parameters
    Type Name Description
    SelectEnterEventArgs args

    SelectEnterEventArgs callback args.

    See Also
    selectEntered

    OnSelectExited(SelectExitEventArgs)

    Callback triggered by IXRSelectInteractor when this interactor is no longer selecting. Refreshes the affordance state.

    Declaration
    protected virtual void OnSelectExited(SelectExitEventArgs args)
    Parameters
    Type Name Description
    SelectExitEventArgs args

    SelectExitEventArgs callback args.

    See Also
    selectExited

    OnUnregistered(InteractorUnregisteredEventArgs)

    Callback triggered when the interactor is unregistered with the XRInteractionManager. Sets the internal isRegistered flag to false and refreshes the affordance state.

    Declaration
    protected virtual void OnUnregistered(InteractorUnregisteredEventArgs args)
    Parameters
    Type Name Description
    InteractorUnregisteredEventArgs args

    InteractorUnregisteredEventArgs callback args.

    RefreshState()

    Re-evaluates the current affordance state and triggers events for receivers if it changed.

    Declaration
    public void RefreshState()

    SelectedClickBehavior()

    Handles starting the selected click animation coroutine. Stops any previously started coroutine.

    Declaration
    protected virtual void SelectedClickBehavior()

    SetBoundInteractionReceiver(IXRInteractor)

    Bind affordance provider state to IXRInteractor state and events.

    Declaration
    public bool SetBoundInteractionReceiver(IXRInteractor interactor)
    Parameters
    Type Name Description
    IXRInteractor interactor

    Receiver to bind events from.

    Returns
    Type Description
    bool

    Whether binding was successful.

    In This Article
    Back to top
    Copyright © 2024 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)