docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class XRAnchorSubsystem.Provider

    An abstract class to be implemented by providers of this subsystem.

    Inheritance
    object
    SubsystemProvider
    SubsystemProvider<XRAnchorSubsystem>
    XRAnchorSubsystem.Provider
    Inherited Members
    SubsystemProvider<XRAnchorSubsystem>.TryInitialize()
    SubsystemProvider<XRAnchorSubsystem>.Start()
    SubsystemProvider<XRAnchorSubsystem>.Stop()
    SubsystemProvider<XRAnchorSubsystem>.Destroy()
    SubsystemProvider.running
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.XR.ARSubsystems
    Assembly: Unity.XR.ARSubsystems.dll
    Syntax
    public abstract class XRAnchorSubsystem.Provider : SubsystemProvider<XRAnchorSubsystem>

    Methods

    GetChanges(XRAnchor, Allocator)

    Gets a TrackableChanges<T> struct containing any changes to anchors since the last time you called this method. You are responsible to Dispose() the returned TrackableChanges instance.

    Declaration
    public abstract TrackableChanges<XRAnchor> GetChanges(XRAnchor defaultAnchor, Allocator allocator)
    Parameters
    Type Name Description
    XRAnchor defaultAnchor

    The default anchor. You should use this to initialize the returned TrackableChanges<T> instance by passing it to the constructor TrackableChanges(int, int, int, Allocator, T).

    Allocator allocator

    An Allocator to use when allocating the returned NativeArrays.

    Returns
    Type Description
    TrackableChanges<XRAnchor>

    The changes to anchors since the last call to this method.

    TryAddAnchor(Pose, out XRAnchor)

    Should create a new anchor with the provided pose.

    Declaration
    public virtual bool TryAddAnchor(Pose pose, out XRAnchor anchor)
    Parameters
    Type Name Description
    Pose pose

    The pose, in session space, of the new anchor.

    XRAnchor anchor

    The new anchor. Must be valid only if this method returns true.

    Returns
    Type Description
    bool

    Should return true if the new anchor was added, otherwise false.

    TryAttachAnchor(TrackableId, Pose, out XRAnchor)

    Should create a new anchor "attached" to the trackable with id attachedToId. The behavior of the anchor depends on the type of trackable to which this anchor is attached and might be implementation-defined.

    Declaration
    public virtual bool TryAttachAnchor(TrackableId attachedToId, Pose pose, out XRAnchor anchor)
    Parameters
    Type Name Description
    TrackableId attachedToId

    The id of the trackable to which to attach.

    Pose pose

    The pose, in session space, of the anchor to create.

    XRAnchor anchor

    The new anchor. Must be valid only if this method returns true.

    Returns
    Type Description
    bool

    true if the new anchor was added, otherwise false.

    TryRemoveAnchor(TrackableId)

    Should remove an existing anchor with TrackableId anchorId.

    Declaration
    public virtual bool TryRemoveAnchor(TrackableId anchorId)
    Parameters
    Type Name Description
    TrackableId anchorId

    The id of an existing anchor to remove.

    Returns
    Type Description
    bool

    Should return true if the anchor was removed, otherwise false. If the anchor does not exist, return false.

    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)