docs.unity3d.com
    Show / Hide Table of Contents

    Interface IXRActivateInteractable

    An interface that represents an Interactable component which Interactor components can activate. Not to be confused with the active state of a GameObject, an activate event in this context refers to a contextual command action, such as toggling a flashlight on and off.

    Inherited Members
    IXRInteractable.registered
    IXRInteractable.unregistered
    IXRInteractable.interactionLayers
    IXRInteractable.colliders
    IXRInteractable.transform
    IXRInteractable.GetAttachTransform(IXRInteractor)
    IXRInteractable.OnRegistered(InteractableRegisteredEventArgs)
    IXRInteractable.OnUnregistered(InteractableUnregisteredEventArgs)
    IXRInteractable.ProcessInteractable(XRInteractionUpdateOrder.UpdatePhase)
    IXRInteractable.GetDistanceSqrToInteractor(IXRInteractor)
    Namespace: UnityEngine.XR.Interaction.Toolkit
    Syntax
    public interface IXRActivateInteractable : IXRInteractable

    Properties

    activated

    The event that is called when the selecting Interactor activates this Interactable.

    Declaration
    ActivateEvent activated { get; }
    Property Value
    Type Description
    ActivateEvent
    Remarks

    Not to be confused with activating or deactivating a GameObject with SetActive. This is a generic event when an Interactor wants to activate an Interactable, such as from a trigger pull on a controller.
    The ActivateEventArgs passed to each listener is only valid while the event is invoked, do not hold a reference to it.

    See Also
    deactivated

    deactivated

    The event that is called when an Interactor deactivates this Interactable.

    Declaration
    DeactivateEvent deactivated { get; }
    Property Value
    Type Description
    DeactivateEvent
    Remarks

    Not to be confused with activating or deactivating a GameObject with SetActive. This is a generic event when an Interactor wants to deactivate an Interactable, such as from a trigger release on a controller.
    The DeactivateEventArgs passed to each listener is only valid while the event is invoked, do not hold a reference to it.

    See Also
    activated

    Methods

    OnActivated(ActivateEventArgs)

    This method is called when the Interactor begins an activation event on this Interactable.

    Declaration
    void OnActivated(ActivateEventArgs args)
    Parameters
    Type Name Description
    ActivateEventArgs args

    Event data containing the Interactor that is sending the activate event.

    Remarks

    args is only valid during this method call, do not hold a reference to it.

    See Also
    OnDeactivated(DeactivateEventArgs)

    OnDeactivated(DeactivateEventArgs)

    This method is called when the Interactor ends an activation event on this Interactable.

    Declaration
    void OnDeactivated(DeactivateEventArgs args)
    Parameters
    Type Name Description
    DeactivateEventArgs args

    Event data containing the Interactor that is sending the deactivate event.

    Remarks

    args is only valid during this method call, do not hold a reference to it.

    See Also
    OnActivated(ActivateEventArgs)

    See Also

    IXRActivateInteractor
    Back to top
    Terms of use
    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