Class ARKitSessionSubsystem | ARKit XR Plugin | 3.0.4
docs.unity3d.com
    Show / Hide Table of Contents

    Class ARKitSessionSubsystem

    ARKit implementation of the XRSessionSubsystem. Do not create this directly. Use the SubsystemManager instead.

    Inheritance
    Object
    ARKitSessionSubsystem
    Namespace: UnityEngine.XR.ARKit
    Syntax
    public sealed class ARKitSessionSubsystem : XRSessionSubsystem

    Properties

    coachingActivatesAutomatically

    Whether the Coaching Overlay activates automatically or not. By default, it does not.

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

    coachingActive

    true if the Coaching Overlay is active.

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

    coachingGoal

    Defines the Coaching Goal. This should be based on your app's tracking requirements and affects the UI that the coaching overlay presents.

    Declaration
    public ARCoachingGoal coachingGoal { get; set; }
    Property Value
    Type Description
    ARCoachingGoal

    coachingOverlaySupported

    true if Coaching Overlay is supported, otherwise false.

    Declaration
    public static bool coachingOverlaySupported { get; }
    Property Value
    Type Description
    Boolean

    collaborationDataCount

    The number of ARCollaborationDatas in the queue. Obtain ARCollaborationData with DequeueCollaborationData().

    Declaration
    public int collaborationDataCount { get; }
    Property Value
    Type Description
    Int32
    See Also
    ARCollaborationData
    DequeueCollaborationData()

    collaborationEnabled

    Get or set whether collaboration is enabled. When collaboration is enabled, collaboration data is accumulated by the subsystem until you read it out with DequeueCollaborationData().

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

    Note: If you change this value, the new value may not be reflected until the next frame.

    See Also
    ARCollaborationData
    DequeueCollaborationData()
    collaborationDataCount

    supportsCollaboration

    True if collaboration is supported. Collaboration is only supported on iOS versions 13.0 and later.

    Declaration
    public static bool supportsCollaboration { get; }
    Property Value
    Type Description
    Boolean
    See Also
    ARCollaborationData

    worldMappingStatus

    Get the world mapping status. Used to determine the suitability of the current session for creating an ARWorldMap.

    Declaration
    public ARWorldMappingStatus worldMappingStatus { get; }
    Property Value
    Type Description
    ARWorldMappingStatus

    The ARWorldMappingStatus of the session.

    worldMapSupported

    Detect ARWorldMap support. ARWorldMap requires iOS 12 or greater.

    Declaration
    public static bool worldMapSupported { get; }
    Property Value
    Type Description
    Boolean

    true if ARWorldMaps are supported, otherwise false.

    See Also
    GetARWorldMapAsync()

    Methods

    ApplyWorldMap(ARWorldMap)

    Apply an existing ARWorldMap to the session. This will attempt to relocalize the current session to the given worldMap. If relocalization is successful, the stored planes and anchors from the worldMap will be added to the current session. This is equivalent to setting the initialWorldMap property on the session's ARWorldTrackingConfiguration.

    Declaration
    public void ApplyWorldMap(ARWorldMap worldMap)
    Parameters
    Type Name Description
    ARWorldMap worldMap

    An ARWorldMap with which to relocalize the session.

    CreateProvider()

    Creates the provider interface.

    Declaration
    protected override Provider CreateProvider()
    Returns
    Type Description
    Provider

    The provider interface for ARKit

    DequeueCollaborationData()

    Dequeues the oldest collaboration data in the queue. After calling this method, collaborationDataCount will be decremented by one.

    Declaration
    public ARCollaborationData DequeueCollaborationData()
    Returns
    Type Description
    ARCollaborationData
    Exceptions
    Type Condition
    NotSupportedException

    Thrown if supportsCollaboration is false.

    InvalidOperationException

    Thrown if collaborationDataCount is zero.

    See Also
    ARCollaborationData

    GetARWorldMapAsync()

    Asynchronously create an ARWorldMap. An ARWorldMap represents the state of the session and can be serialized to a byte array to persist the session data, or send it to another device for shared AR experiences.

    It is a wrapper for ARKit's ARWorldMap.

    Declaration
    public ARWorldMapRequest GetARWorldMapAsync()
    Returns
    Type Description
    ARWorldMapRequest

    An ARWorldMapRequest which can be used to determine the status of the request and get the ARWorldMap when complete.

    See Also
    ApplyWorldMap(ARWorldMap)
    worldMapSupported

    GetARWorldMapAsync(Action<ARWorldMapRequestStatus, ARWorldMap>)

    Asynchronously create an ARWorldMap. An ARWorldMap represents the state of the session and can be serialized to a byte array to persist the session data, or send it to another device for shared AR experiences.

    It is a wrapper for ARKit's ARWorldMap.

    If the ARWorldMapRequestStatus is Success, then the resulting ARWorldMap must be disposed to avoid leaking native resources. Otherwise, the ARWorldMap is not valid, and need not be disposed.

    Declaration
    public void GetARWorldMapAsync(Action<ARWorldMapRequestStatus, ARWorldMap> onComplete)
    Parameters
    Type Name Description
    Action<ARWorldMapRequestStatus, ARWorldMap> onComplete

    A method to invoke when the world map has either been created, or determined that it could not be created. Check the value of the ARWorldMapRequestStatus parameter to determine whether the world map was successfully created.

    See Also
    ApplyWorldMap(ARWorldMap)
    worldMapSupported

    SetCoachingActive(Boolean, ARCoachingOverlayTransition)

    Activates or deactivates the Coaching Overlay

    Declaration
    public void SetCoachingActive(bool active, ARCoachingOverlayTransition transition)
    Parameters
    Type Name Description
    Boolean active

    Whether the coaching overlay should be active or not.

    ARCoachingOverlayTransition transition

    UpdateWithCollaborationData(ARCollaborationData)

    Applies ARCollaborationData to the session.

    Declaration
    public void UpdateWithCollaborationData(ARCollaborationData collaborationData)
    Parameters
    Type Name Description
    ARCollaborationData collaborationData
    Exceptions
    Type Condition
    NotSupportedException

    Thrown if supportsCollaboration is false.

    InvalidOperationException

    Thrown if collaborationData is not valid.

    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