docs.unity.cn
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.ReferenceEquals(object, object)
    object.GetType()
    object.MemberwiseClone()
    Namespace: UnityEngine.XR.Interaction.Toolkit
    Assembly: solution.dll
    Syntax
    [DisallowMultipleComponent]
    [AddComponentMenu("XR/XR Socket Interactor", 11)]
    [HelpURL("https://docs.unity.cn/Packages/com.unity.xr.interaction.toolkit@3.0/api/UnityEngine.XR.Interaction.Toolkit.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

    Name Description
    ejectExistingSocketsWhenSnapping

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

    fixedScale

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

    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.

    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).

    interactableHoverMeshMaterial

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

    interactableHoverScale

    Scale at which to render hovered Interactable.

    isHoverActive

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

    isSelectActive

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

    recycleDelayTime

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

    selectedInteractableMovementTypeOverride

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

    showInteractableHoverMeshes

    Whether this socket should show a mesh at socket's attach point for Interactables that it is hovering over.

    socketActive

    Whether socket interaction is enabled.

    socketScaleMode

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

    socketSnappingLimit

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

    socketSnappingRadius

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

    targetBoundsSize

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

    unsortedValidTargets

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

    Methods

    Name Description
    Awake()

    See MonoBehaviour.

    CanHover(IXRHoverInteractable)

    Determines if the Interactable is valid for hover this frame.

    CanHoverSnap(IXRInteractable)

    Determines whether the specified IXRInteractable object can hover snap.

    CanSelect(IXRSelectInteractable)

    Determines if the Interactable is valid for selection this frame.

    CreateDefaultHoverMaterials()

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

    DrawHoveredInteractables()

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

    EndSocketSnapping(XRGrabInteractable)

    Ends socket snapping for a specified XRGrabInteractable object.

    GetHoveredInteractableMaterial(IXRHoverInteractable)

    Gets the material used 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).

    OnDisable()

    See MonoBehaviour.

    OnEnable()

    See MonoBehaviour.

    OnHoverEntered(HoverEnterEventArgs)

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

    OnHoverEntering(HoverEnterEventArgs)

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

    OnHoverExiting(HoverExitEventArgs)

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

    OnRegistered(InteractorRegisteredEventArgs)

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

    OnSelectEntered(SelectEnterEventArgs)

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

    OnSelectExited(SelectExitEventArgs)

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

    OnSelectExiting(SelectExitEventArgs)

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

    OnTriggerEnter(Collider)

    See MonoBehaviour.

    OnTriggerExit(Collider)

    See MonoBehaviour.

    OnTriggerStay(Collider)

    See MonoBehaviour.

    OnUnregistered(InteractorUnregisteredEventArgs)

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

    OnValidate()

    See MonoBehaviour.

    ProcessInteractor(UpdatePhase)

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

    ShouldDrawHoverMesh(MeshFilter, Renderer, Camera)

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

    StartSocketSnapping(XRGrabInteractable)

    Initiates socket snapping for a specified XRGrabInteractable object.

    Extension Methods

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