Class XRSocketInteractor | XR Interaction Toolkit | 0.0.6-preview
docs.unity3d.com
    Show / Hide Table of Contents

    Class XRSocketInteractor

    Interactor used for holding interactables via a socket. This component is not designed to be attached to a controller (thus does not derive from XRBaseControllerInteractor) and instead will always attempt to select an interactable that it is hovering (though will not perform exclusive selection of that interactable).

    Inheritance
    Object
    XRBaseInteractor
    XRSocketInteractor
    Inherited Members
    XRBaseInteractor.interactionManager
    XRBaseInteractor.InteractionLayerMask
    XRBaseInteractor.attachTransform
    XRBaseInteractor.selectTarget
    XRBaseInteractor.m_HoverTargets
    XRBaseInteractor.startingSelectedInteractable
    XRBaseInteractor.interactionLayerMask
    XRBaseInteractor.onHoverEnter
    XRBaseInteractor.onHoverExit
    XRBaseInteractor.onSelectEnter
    XRBaseInteractor.onSelectExit
    XRBaseInteractor.allowHover
    XRBaseInteractor.allowSelect
    XRBaseInteractor.enableInteractions
    XRBaseInteractor.Reset()
    XRBaseInteractor.OnEnable()
    XRBaseInteractor.OnDisable()
    XRBaseInteractor.GetHoverTargets(List<XRBaseInteractable>)
    XRBaseInteractor.overrideSelectedInteractableMovement
    XRBaseInteractor.OnSelectEnter(XRBaseInteractable)
    Namespace: UnityEngine.XR.Interaction.Toolkit
    Syntax
    public class XRSocketInteractor : XRBaseInteractor

    Properties

    interactableHoverScale

    Gets or sets Scale at which to render hovered interactable.

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

    isHoverActive

    Gets whether this interactor is in a state where it could hover (always true for sockets if active).

    Declaration
    public override bool isHoverActive { get; }
    Property Value
    Type Description
    Boolean
    Overrides
    XRBaseInteractor.isHoverActive

    isSelectActive

    Gets whether this interactor is in a state where it could select (always true for sockets if active).

    Declaration
    public override bool isSelectActive { get; }
    Property Value
    Type Description
    Boolean
    Overrides
    XRBaseInteractor.isSelectActive

    isSelectExclusive

    Gets if this interactor requires exclusive selection of an interactable (always false for sockets).

    Declaration
    public override bool isSelectExclusive { get; }
    Property Value
    Type Description
    Boolean
    Overrides
    XRBaseInteractor.isSelectExclusive

    recycleDelayTime

    Sets the amount of time the socket will refuse hovers after an object is removed.

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

    selectedInteractableMovementTypeOverride

    Gets the movement type to use when overriding the selected interactable's movement (always Kinematic for sockets).

    Declaration
    public override XRBaseInteractable.MovementType? selectedInteractableMovementTypeOverride { get; }
    Property Value
    Type Description
    Nullable<XRBaseInteractable.MovementType>
    Overrides
    XRBaseInteractor.selectedInteractableMovementTypeOverride

    showInteractableHoverMeshes

    Gets or sets whether this socket should show a mesh at socket's attach point for interactables that it is hovering over.

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

    socketActive

    Gets or sets whether socket interaction is enabled.

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

    Methods

    Awake()

    Declaration
    protected override void Awake()
    Overrides
    XRBaseInteractor.Awake()

    CanHover(XRBaseInteractable)

    Declaration
    public override bool CanHover(XRBaseInteractable interactable)
    Parameters
    Type Name Description
    XRBaseInteractable interactable
    Returns
    Type Description
    Boolean
    Overrides
    XRBaseInteractor.CanHover(XRBaseInteractable)

    CanSelect(XRBaseInteractable)

    Determines if the interactable is valid for selection this frame.

    Declaration
    public override bool CanSelect(XRBaseInteractable interactable)
    Parameters
    Type Name Description
    XRBaseInteractable interactable

    Interactable to check.

    Returns
    Type Description
    Boolean

    true if the interactable can be selected this frame.

    Overrides
    XRBaseInteractor.CanSelect(XRBaseInteractable)

    DrawHoveredInteractables()

    Declaration
    protected virtual void DrawHoveredInteractables()

    GetValidTargets(List<XRBaseInteractable>)

    Retrieve the list of interactables that this interactor could possibly interact with this frame. This list is sorted by priority (in this case distance).

    Declaration
    public override void GetValidTargets(List<XRBaseInteractable> validTargets)
    Parameters
    Type Name Description
    List<XRBaseInteractable> validTargets

    Populated List of interactables that are valid for selection or hover.

    Overrides
    XRBaseInteractor.GetValidTargets(List<XRBaseInteractable>)

    OnHoverEnter(XRBaseInteractable)

    Declaration
    protected override void OnHoverEnter(XRBaseInteractable interactable)
    Parameters
    Type Name Description
    XRBaseInteractable interactable
    Overrides
    XRBaseInteractor.OnHoverEnter(XRBaseInteractable)

    OnHoverExit(XRBaseInteractable)

    Declaration
    protected override void OnHoverExit(XRBaseInteractable interactable)
    Parameters
    Type Name Description
    XRBaseInteractable interactable
    Overrides
    XRBaseInteractor.OnHoverExit(XRBaseInteractable)

    OnSelectExit(XRBaseInteractable)

    Declaration
    protected override void OnSelectExit(XRBaseInteractable interactable)
    Parameters
    Type Name Description
    XRBaseInteractable interactable
    Overrides
    XRBaseInteractor.OnSelectExit(XRBaseInteractable)

    OnTriggerEnter(Collider)

    Declaration
    protected void OnTriggerEnter(Collider col)
    Parameters
    Type Name Description
    Collider col

    OnTriggerExit(Collider)

    Declaration
    protected void OnTriggerExit(Collider col)
    Parameters
    Type Name Description
    Collider col

    ProcessInteractor(XRInteractionUpdateOrder.UpdatePhase)

    Declaration
    public override void ProcessInteractor(XRInteractionUpdateOrder.UpdatePhase updatePhase)
    Parameters
    Type Name Description
    XRInteractionUpdateOrder.UpdatePhase updatePhase
    Overrides
    XRBaseInteractor.ProcessInteractor(XRInteractionUpdateOrder.UpdatePhase)
    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