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
    XRSubsystem<XRSessionSubsystemDescriptor>
    XRSessionSubsystem
    ARKitSessionSubsystem
    Inherited Members
    XRSessionSubsystem.GetAvailabilityAsync()
    XRSessionSubsystem.InstallAsync()
    XRSessionSubsystem.OnStart()
    XRSessionSubsystem.Reset()
    XRSessionSubsystem.OnStop()
    XRSessionSubsystem.OnDestroyed()
    XRSessionSubsystem.DetermineConfiguration(Feature)
    XRSessionSubsystem.Update(XRSessionUpdateParams)
    XRSessionSubsystem.GetConfigurationDescriptors(Allocator)
    XRSessionSubsystem.OnApplicationPause()
    XRSessionSubsystem.OnApplicationResume()
    XRSessionSubsystem.nativePtr
    XRSessionSubsystem.sessionId
    XRSessionSubsystem.currentConfiguration
    XRSessionSubsystem.requestedFeatures
    XRSessionSubsystem.trackingState
    XRSessionSubsystem.requestedTrackingMode
    XRSessionSubsystem.currentTrackingMode
    XRSessionSubsystem.configurationChooser
    XRSessionSubsystem.notTrackingReason
    XRSessionSubsystem.matchFrameRateEnabled
    XRSessionSubsystem.matchFrameRateRequested
    XRSessionSubsystem.frameRate
    XRSessionSubsystem.provider
    XRSubsystem<XRSessionSubsystemDescriptor>.OnDestroy()
    XRSubsystem<XRSessionSubsystemDescriptor>.Start()
    XRSubsystem<XRSessionSubsystemDescriptor>.Stop()
    XRSubsystem<XRSessionSubsystemDescriptor>.running
    Namespace: UnityEngine.XR.ARKit
    Syntax
    [Preserve]
    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 property is obsolete. Use requestedCoachingGoal or currentCoachingGoal instead.

    Declaration
    [Obsolete("Use requestedCoachingGoal or currentCoachingGoal instead. (2020-01-17)")]
    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

    Queries whether collaboration is currently enabled.

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

    collaborationRequested

    Get 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 collaborationRequested { 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

    currentCoachingGoal

    The current Coaching Goal. This may be different than the requestedCoachingGoal.

    Declaration
    public ARCoachingGoal currentCoachingGoal { get; }
    Property Value
    Type Description
    ARCoachingGoal

    The type of goal the coaching overlay will guide the user through.

    currentWorldAlignment

    The current ARWorldAlignment for the session.

    Declaration
    public ARWorldAlignment currentWorldAlignment { get; }
    Property Value
    Type Description
    ARWorldAlignment

    requestedCoachingGoal

    Requests 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 requestedCoachingGoal { get; set; }
    Property Value
    Type Description
    ARCoachingGoal

    The type of goal the coaching overlay should guide the user through.

    requestedWorldAlignment

    The requested ARWorldAlignment for the session.

    Declaration
    public ARWorldAlignment requestedWorldAlignment { get; set; }
    Property Value
    Type Description
    ARWorldAlignment
    Remarks

    Note: GravityAndHeading requires location services to be enabled and the user must grant your app permission to use location services. You must therefore provide a Location Usage Description entry in the Player Settings.

    sessionDelegate

    The ARKitSessionDelegate to use for session-related callbacks.

    Declaration
    public ARKitSessionDelegate sessionDelegate { get; set; }
    Property Value
    Type Description
    ARKitSessionDelegate

    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)

    Applies an ARWorldMap to the session.

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

    An ARWorldMap with which to relocalize the session.

    Remarks

    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.

    If worldMap is not valid, this method sets the initialWorldMap configuration property to nil.

    CreateProvider()

    Creates the provider interface.

    Declaration
    protected override XRSessionSubsystem.Provider CreateProvider()
    Returns
    Type Description
    XRSessionSubsystem.Provider

    The provider interface for ARKit

    Overrides
    XRSessionSubsystem.CreateProvider()

    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

    The nextx ARCollaborationData in the queue.

    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

    The type of transition to use when showing or hiding the coaching overlay.

    UpdateWithCollaborationData(ARCollaborationData)

    Applies ARCollaborationData to the session.

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

    The ARCollaborationData to apply to the session.

    Exceptions
    Type Condition
    NotSupportedException

    Thrown if supportsCollaboration is false.

    InvalidOperationException

    Thrown if collaborationData is not valid.

    Back to top
    Terms of use
    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