docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class XRSocketInteractor

    Interactor used for holding interactables via a socket.

    Inheritance
    object
    Object
    Component
    Behaviour
    MonoBehaviour
    XRBaseInteractor
    XRSocketInteractor
    Implements
    IXRHoverInteractor
    IXRSelectInteractor
    IXRTargetPriorityInteractor
    IXRGroupMember
    IXRInteractionStrengthInteractor
    IXRInteractor
    Inherited Members
    XRBaseInteractor.registered
    XRBaseInteractor.unregistered
    XRBaseInteractor.interactionManager
    XRBaseInteractor.containingGroup
    XRBaseInteractor.interactionLayers
    XRBaseInteractor.handedness
    XRBaseInteractor.attachTransform
    XRBaseInteractor.keepSelectedTargetValid
    XRBaseInteractor.disableVisualsWhenBlockedInGroup
    XRBaseInteractor.startingSelectedInteractable
    XRBaseInteractor.startingTargetFilter
    XRBaseInteractor.hoverEntered
    XRBaseInteractor.hoverExited
    XRBaseInteractor.selectEntered
    XRBaseInteractor.selectExited
    XRBaseInteractor.targetFilter
    XRBaseInteractor.allowHover
    XRBaseInteractor.allowSelect
    XRBaseInteractor.isPerformingManualInteraction
    XRBaseInteractor.interactablesHovered
    XRBaseInteractor.hasHover
    XRBaseInteractor.interactablesSelected
    XRBaseInteractor.firstInteractableSelected
    XRBaseInteractor.hasSelection
    XRBaseInteractor.startingHoverFilters
    XRBaseInteractor.hoverFilters
    XRBaseInteractor.startingSelectFilters
    XRBaseInteractor.selectFilters
    XRBaseInteractor.largestInteractionStrength
    XRBaseInteractor.Reset()
    XRBaseInteractor.Start()
    XRBaseInteractor.OnDestroy()
    XRBaseInteractor.GetAttachTransform(IXRInteractable)
    XRBaseInteractor.GetAttachPoseOnSelect(IXRSelectInteractable)
    XRBaseInteractor.GetLocalAttachPoseOnSelect(IXRSelectInteractable)
    XRBaseInteractor.targetPriorityMode
    XRBaseInteractor.targetsForSelection
    XRBaseInteractor.IsHovering(IXRHoverInteractable)
    XRBaseInteractor.IsSelecting(IXRSelectInteractable)
    XRBaseInteractor.IsHovering(IXRInteractable)
    XRBaseInteractor.IsSelecting(IXRInteractable)
    XRBaseInteractor.CaptureAttachPose(IXRSelectInteractable)
    XRBaseInteractor.CreateAttachTransform()
    XRBaseInteractor.PreprocessInteractor(XRInteractionUpdateOrder.UpdatePhase)
    XRBaseInteractor.GetInteractionStrength(IXRInteractable)
    XRBaseInteractor.OnHoverExited(HoverExitEventArgs)
    XRBaseInteractor.OnSelectEntering(SelectEnterEventArgs)
    XRBaseInteractor.ProcessInteractionStrength(XRInteractionUpdateOrder.UpdatePhase)
    XRBaseInteractor.StartManualInteraction(IXRSelectInteractable)
    XRBaseInteractor.EndManualInteraction()
    XRBaseInteractor.ProcessHoverFilters(IXRHoverInteractable)
    XRBaseInteractor.ProcessSelectFilters(IXRSelectInteractable)
    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.Interactors
    Assembly: Unity.XR.Interaction.Toolkit.dll
    Syntax
    [MovedFrom("UnityEngine.XR.Interaction.Toolkit")]
    [DisallowMultipleComponent]
    [AddComponentMenu("XR/Interactors/XR Socket Interactor", 11)]
    [HelpURL("https://docs.unity3d.com/Packages/com.unity.xr.interaction.toolkit@3.0/api/UnityEngine.XR.Interaction.Toolkit.Interactors.XRSocketInteractor.html")]
    public class XRSocketInteractor : XRBaseInteractor, IXRHoverInteractor, IXRSelectInteractor, IXRTargetPriorityInteractor, IXRGroupMember, IXRInteractionStrengthInteractor, IXRInteractor
    Remarks

    A socket is defined as the target for a specific interactable, such as a keyhole for a key or a battery socket for a battery. Not to be confused with network programming.
    This component is not designed to use input (thus does not derive from XRBaseInputInteractor) and instead will always attempt to select an interactable that it is hovering over.

    Properties

    ejectExistingSocketsWhenSnapping

    Determines if when snapping to a socket, any existing sockets should be ejected.

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

    fixedScale

    Scale factor applied to the interactable when scale mode is set to Fixed.

    Declaration
    public Vector3 fixedScale { get; set; }
    Property Value
    Type Description
    Vector3
    See Also
    socketScaleMode

    hoverSocketSnapping

    Determines if the interactable should snap to the socket's attach transform when hovering. Note this will cause z-fighting with the hover mesh visuals, so it is recommended to disable showInteractableHoverMeshes if this is active. If enabled, hover recycle delay functionality is disabled to prevent snap flickering.

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

    interactableCantHoverMeshMaterial

    Material used for rendering interactable meshes on hover when there is already a selected object in the socket (a default material will be created if none is supplied).

    Declaration
    public Material interactableCantHoverMeshMaterial { get; set; }
    Property Value
    Type Description
    Material

    interactableHoverMeshMaterial

    Material used for rendering interactable meshes on hover (a default material will be created if none is supplied).

    Declaration
    public Material interactableHoverMeshMaterial { get; set; }
    Property Value
    Type Description
    Material

    interactableHoverScale

    Scale at which to render hovered Interactable.

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

    isHoverActive

    (Read Only) Indicates whether this Interactor is in a state where it could hover.

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

    isSelectActive

    (Read Only) Indicates whether this Interactor is in a state where it could select.

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

    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
    float
    Remarks

    Does nothing if hoverSocketSnapping is enabled to prevent snap flickering.

    selectedInteractableMovementTypeOverride

    (Read Only) Overriding movement type of the selected Interactable's movement. By default, this does not override the movement type.

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

    You can use this to change the effective movement type of an Interactable for different Interactors. An example would be having an Interactable use VelocityTracking so it does not move through geometry with a Collider when interacting with it using a Ray or Direct Interactor, but have a Socket Interactor override the movement type to be Instantaneous for reduced movement latency.

    See Also
    movementType

    showInteractableHoverMeshes

    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
    bool
    Remarks

    The interactable's attach transform must not change parent Transform while selected for the position and rotation of the hover mesh to be correctly calculated.

    socketActive

    Whether socket interaction is enabled.

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

    socketScaleMode

    Scale mode used to calculate the scale factor applied to the interactable when hovering.

    Declaration
    public SocketScaleMode socketScaleMode { get; set; }
    Property Value
    Type Description
    SocketScaleMode
    See Also
    SocketScaleMode

    socketSnappingLimit

    Maximum number of interactables this interactor can socket. Used for hover socket snapping evaluation.

    Declaration
    protected virtual int socketSnappingLimit { get; }
    Property Value
    Type Description
    int

    socketSnappingRadius

    When socket snapping is enabled, this is the radius within which the interactable will snap to the socket's attach transform while hovering.

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

    targetBoundsSize

    Bounds size used to calculate the scale factor applied to the interactable when scale mode is set to StretchedToFitSize.

    Declaration
    public Vector3 targetBoundsSize { get; set; }
    Property Value
    Type Description
    Vector3
    See Also
    socketScaleMode

    unsortedValidTargets

    The set of Interactables that this Interactor could possibly interact with this frame. This list is not sorted by priority.

    Declaration
    protected List<IXRInteractable> unsortedValidTargets { get; }
    Property Value
    Type Description
    List<IXRInteractable>
    See Also
    GetValidTargets(List<IXRInteractable>)

    Methods

    Awake()

    See MonoBehaviour.

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

    CanHover(IXRHoverInteractable)

    Determines if the Interactable is valid for hover this frame.

    Declaration
    public override bool CanHover(IXRHoverInteractable interactable)
    Parameters
    Type Name Description
    IXRHoverInteractable interactable

    Interactable to check.

    Returns
    Type Description
    bool

    Returns true if the Interactable can be hovered over this frame.

    Overrides
    XRBaseInteractor.CanHover(IXRHoverInteractable)
    See Also
    IsHoverableBy(IXRHoverInteractor)

    CanHoverSnap(IXRInteractable)

    Determines whether the specified IXRInteractable object can hover snap.

    Declaration
    protected virtual bool CanHoverSnap(IXRInteractable interactable)
    Parameters
    Type Name Description
    IXRInteractable interactable

    The IXRInteractable object to check for hover snap capability.

    Returns
    Type Description
    bool

    Returns true if hover socket snapping is enabled and the interactable has no selection or is selecting; otherwise, false.

    Remarks

    This method checks whether hover socket snapping is allowed and whether the specified interactable has no current selection or is in the process of selecting.

    CanSelect(IXRSelectInteractable)

    Determines if the Interactable is valid for selection this frame.

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

    Interactable to check.

    Returns
    Type Description
    bool

    Returns true if the Interactable can be selected this frame.

    Overrides
    XRBaseInteractor.CanSelect(IXRSelectInteractable)
    See Also
    IsSelectableBy(IXRSelectInteractor)

    CreateDefaultHoverMaterials()

    Creates the default hover materials for interactableHoverMeshMaterial and interactableCantHoverMeshMaterial if necessary.

    Declaration
    protected virtual void CreateDefaultHoverMaterials()

    DrawHoveredInteractables()

    Unity calls this method automatically in order to draw the Interactables that are currently being hovered over.

    Declaration
    protected virtual void DrawHoveredInteractables()
    See Also
    GetHoveredInteractableMaterial(IXRHoverInteractable)

    EndSocketSnapping(XRGrabInteractable)

    Ends socket snapping for a specified XRGrabInteractable object.

    Declaration
    protected virtual bool EndSocketSnapping(XRGrabInteractable grabInteractable)
    Parameters
    Type Name Description
    XRGrabInteractable grabInteractable

    The XRGrabInteractable object to end socket snapping for.

    Returns
    Type Description
    bool

    Returns true if the specified grab interactable was found and removed; otherwise, false.

    Remarks

    Removes the specified grab interactable from the local interactables with socket transformer list and removes it from the socket grab transformer.

    See Also
    StartSocketSnapping(XRGrabInteractable)

    GetHoveredInteractableMaterial(IXRHoverInteractable)

    Gets the material used to draw the given hovered Interactable.

    Declaration
    protected virtual Material GetHoveredInteractableMaterial(IXRHoverInteractable interactable)
    Parameters
    Type Name Description
    IXRHoverInteractable interactable

    The hovered Interactable to get the material for.

    Returns
    Type Description
    Material

    Returns the material Unity should use to draw the given hovered Interactable.

    GetValidTargets(List<IXRInteractable>)

    Retrieve the list of Interactables that this Interactor could possibly interact with this frame. This list is sorted by priority (with highest priority first).

    Declaration
    public override void GetValidTargets(List<IXRInteractable> targets)
    Parameters
    Type Name Description
    List<IXRInteractable> targets

    The results list to populate with Interactables that are valid for selection or hover.

    Overrides
    XRBaseInteractor.GetValidTargets(List<IXRInteractable>)
    Remarks

    When implementing this method, Unity expects you to clear targets before adding to it.

    OnDisable()

    See MonoBehaviour.

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

    OnEnable()

    See MonoBehaviour.

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

    OnHoverEntered(HoverEnterEventArgs)

    The XRInteractionManager calls this method when the Interactor first initiates hovering over an Interactable in a second pass.

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

    Event data containing the Interactable that is being hovered over.

    Overrides
    XRBaseInteractor.OnHoverEntered(HoverEnterEventArgs)
    Remarks

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

    See Also
    OnHoverExited(HoverExitEventArgs)

    OnHoverEntering(HoverEnterEventArgs)

    The XRInteractionManager calls this method right before the Interactor first initiates hovering over an Interactable in a first pass.

    Declaration
    protected override void OnHoverEntering(HoverEnterEventArgs args)
    Parameters
    Type Name Description
    HoverEnterEventArgs args

    Event data containing the Interactable that is being hovered over.

    Overrides
    XRBaseInteractor.OnHoverEntering(HoverEnterEventArgs)
    Remarks

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

    See Also
    OnHoverEntered(HoverEnterEventArgs)

    OnHoverExiting(HoverExitEventArgs)

    The XRInteractionManager calls this method right before the Interactor ends hovering over an Interactable in a first pass.

    Declaration
    protected override void OnHoverExiting(HoverExitEventArgs args)
    Parameters
    Type Name Description
    HoverExitEventArgs args

    Event data containing the Interactable that is no longer hovered over.

    Overrides
    XRBaseInteractor.OnHoverExiting(HoverExitEventArgs)
    Remarks

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

    See Also
    OnHoverExited(HoverExitEventArgs)

    OnRegistered(InteractorRegisteredEventArgs)

    The XRInteractionManager calls this method when this Interactor is registered with it.

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

    Event data containing the Interaction Manager that registered this Interactor.

    Overrides
    XRBaseInteractor.OnRegistered(InteractorRegisteredEventArgs)
    Remarks

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

    See Also
    RegisterInteractor(IXRInteractor)

    OnSelectEntered(SelectEnterEventArgs)

    The XRInteractionManager calls this method when the Interactor first initiates selection of an Interactable in a second pass.

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

    Event data containing the Interactable that is being selected.

    Overrides
    XRBaseInteractor.OnSelectEntered(SelectEnterEventArgs)
    Remarks

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

    See Also
    OnSelectExited(SelectExitEventArgs)

    OnSelectExited(SelectExitEventArgs)

    The XRInteractionManager calls this method when the Interactor ends selection of an Interactable in a second pass.

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

    Event data containing the Interactable that is no longer selected.

    Overrides
    XRBaseInteractor.OnSelectExited(SelectExitEventArgs)
    Remarks

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

    See Also
    OnSelectEntered(SelectEnterEventArgs)

    OnSelectExiting(SelectExitEventArgs)

    The XRInteractionManager calls this method right before the Interactor ends selection of an Interactable in a first pass.

    Declaration
    protected override void OnSelectExiting(SelectExitEventArgs args)
    Parameters
    Type Name Description
    SelectExitEventArgs args

    Event data containing the Interactable that is no longer selected.

    Overrides
    XRBaseInteractor.OnSelectExiting(SelectExitEventArgs)
    Remarks

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

    See Also
    OnSelectExited(SelectExitEventArgs)

    OnTriggerEnter(Collider)

    See MonoBehaviour.

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

    The other Collider involved in this collision.

    OnTriggerExit(Collider)

    See MonoBehaviour.

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

    The other Collider involved in this collision.

    OnTriggerStay(Collider)

    See MonoBehaviour.

    Declaration
    protected void OnTriggerStay(Collider other)
    Parameters
    Type Name Description
    Collider other

    The other Collider involved in this collision.

    OnUnregistered(InteractorUnregisteredEventArgs)

    The XRInteractionManager calls this method when this Interactor is unregistered from it.

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

    Event data containing the Interaction Manager that unregistered this Interactor.

    Overrides
    XRBaseInteractor.OnUnregistered(InteractorUnregisteredEventArgs)
    Remarks

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

    See Also
    UnregisterInteractor(IXRInteractor)

    OnValidate()

    See MonoBehaviour.

    Declaration
    protected virtual void OnValidate()

    ProcessInteractor(UpdatePhase)

    The XRInteractionManager or containing IXRInteractionGroup calls this method to update the Interactor after interaction events occur.

    Declaration
    public override void ProcessInteractor(XRInteractionUpdateOrder.UpdatePhase updatePhase)
    Parameters
    Type Name Description
    XRInteractionUpdateOrder.UpdatePhase updatePhase

    The update phase this is called during.

    Overrides
    XRBaseInteractor.ProcessInteractor(XRInteractionUpdateOrder.UpdatePhase)
    Remarks

    Please see the XRInteractionManager and XRInteractionUpdateOrder.UpdatePhase documentation for more details on update order.

    See Also
    XRInteractionUpdateOrder.UpdatePhase
    ProcessInteractable(UpdatePhase)

    ShouldDrawHoverMesh(MeshFilter, Renderer, Camera)

    Unity calls this method automatically in order to determine whether the mesh should be drawn.

    Declaration
    protected virtual bool ShouldDrawHoverMesh(MeshFilter meshFilter, Renderer meshRenderer, Camera mainCamera)
    Parameters
    Type Name Description
    MeshFilter meshFilter

    The MeshFilter which will be drawn when returning true.

    Renderer meshRenderer

    The Renderer on the same GameObject as the meshFilter.

    Camera mainCamera

    The Main Camera.

    Returns
    Type Description
    bool

    Returns true if the mesh should be drawn. Otherwise, returns false.

    See Also
    DrawHoveredInteractables()

    StartSocketSnapping(XRGrabInteractable)

    Initiates socket snapping for a specified XRGrabInteractable object.

    Declaration
    protected virtual bool StartSocketSnapping(XRGrabInteractable grabInteractable)
    Parameters
    Type Name Description
    XRGrabInteractable grabInteractable

    The XRGrabInteractable object to initiate socket snapping for.

    Returns
    Type Description
    bool

    Returns true if the operation is successful; false if the socket snapping has already started for the interactable or if the number of interactables with socket transformer exceeds the socket limit.

    Remarks

    If the socket snapping has already started for the interactable, or if the number of interactables with socket transformer exceeds the socket limit, the method does nothing. Otherwise, it adds the specified grab interactable to the socket grab transformer and adds it to the global and local interactables with socket transformer lists.

    See Also
    EndSocketSnapping(XRGrabInteractable)

    Implements

    IXRHoverInteractor
    IXRSelectInteractor
    IXRTargetPriorityInteractor
    IXRGroupMember
    IXRInteractionStrengthInteractor
    IXRInteractor

    Extension Methods

    XRGroupMemberExtensions.GetTopLevelContainingGroup(IXRGroupMember)
    XRHoverInteractorExtensions.GetOldestInteractableHovered(IXRHoverInteractor)
    XRInteractorExtensions.IsBlockedByInteractionWithinGroup(IXRInteractor)
    XRSelectInteractorExtensions.GetOldestInteractableSelected(IXRSelectInteractor)
    In This Article
    Back to top
    Copyright © 2025 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)