Class ARKitSessionSubsystem
ARKit implementation of the XRSessionSubsystem
. Do not create this directly. Use the SubsystemManager
instead.
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
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
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
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 |
|
See Also
Methods
ApplyWorldMap(ARWorldMap)
Declaration
public void ApplyWorldMap(ARWorldMap worldMap)
Parameters
Type | Name | Description |
---|---|---|
ARWorldMap | worldMap |
CreateProvider()
Creates the provider interface.
Declaration
protected override IProvider CreateProvider()
Returns
Type | Description |
---|---|
IProvider | 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
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 |
See Also
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
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 |