docs.unity3d.com
    Show / Hide Table of Contents

    Class XRAnchorSubsystem.Provider

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

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

    Methods

    GetChanges(XRAnchor, Allocator)

    Invoked to get the changes to anchors (added, updated, and removed) since the last call to GetChanges(XRAnchor, Allocator).

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

    The default anchor. This should be used to initialize the returned NativeArrays for backwards compatibility. See TrackableChanges(Void*, Int32, Void*, Int32, Void*, Int32, T, Int32, Allocator).

    Unity.Collections.Allocator allocator

    An allocator to use for the NativeArrays in TrackableChanges<T>.

    Returns
    Type Description
    TrackableChanges<XRAnchor>

    Changes since the last call to GetChanges(XRAnchor, Allocator).

    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
    UnityEngine.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
    Boolean

    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 trackableToAffix. 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 trackableToAffix, Pose pose, out XRAnchor anchor)
    Parameters
    Type Name Description
    TrackableId trackableToAffix

    The id of the trackable to which to attach.

    UnityEngine.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
    Boolean

    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
    Boolean

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

    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