Class ARKitSessionSubsystem
ARKit implementation of the XRSessionSubsystem
. Do not create this directly. Use the SubsystemManager
instead.
Inheritance
Implements
Inherited Members
Namespace: UnityEngine .XR.ARKit
Assembly: Unity.XR.ARKit.dll
Syntax
[Preserve]
public sealed class ARKitSessionSubsystem : XRSessionSubsystem, ISubsystem
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 |
---|---|
bool |
coachingActive
true if the Coaching Overlay is active. Otherwise, false.
Declaration
public bool coachingActive { get; }
Property Value
Type | Description |
---|---|
bool |
coachingOverlaySupported
true if Coaching Overlay is supported. Otherwise, false.
Declaration
public static bool coachingOverlaySupported { get; }
Property Value
Type | Description |
---|---|
bool |
collaborationDataCount
The number of ARCollaboration
Declaration
public int collaborationDataCount { get; }
Property Value
Type | Description |
---|---|
int |
See Also
collaborationEnabled
Queries whether collaboration is currently enabled.
Declaration
public bool collaborationEnabled { get; }
Property Value
Type | Description |
---|---|
bool |
collaborationRequested
Get whether
collaboration is enabled.
When collaboration is enabled,
collaboration data
is accumulated by the subsystem until you read it out with Dequeue
Declaration
public bool collaborationRequested { get; set; }
Property Value
Type | Description |
---|---|
bool |
Remarks
Note: If you change this value, the new value might not be reflected until the next frame.
See Also
currentCoachingGoal
The current Coaching Goal.
This can be different than the requested
Declaration
public ARCoachingGoal currentCoachingGoal { get; }
Property Value
Type | Description |
---|---|
ARCoaching |
The coaching goal. |
currentWorldAlignment
The current ARWorld
Declaration
public ARWorldAlignment currentWorldAlignment { get; }
Property Value
Type | Description |
---|---|
ARWorld |
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 |
---|---|
ARCoaching |
The type of goal the coaching overlay should guide the user through. |
requestedWorldAlignment
The requested ARWorld
Declaration
public ARWorldAlignment requestedWorldAlignment { get; set; }
Property Value
Type | Description |
---|---|
ARWorld |
Remarks
Note
Gravity
sessionDelegate
The ARKit
Declaration
public ARKitSessionDelegate sessionDelegate { get; set; }
Property Value
Type | Description |
---|---|
ARKit |
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 |
---|---|
bool |
See Also
worldMapSupported
Detect ARWorldARWorldMap
requires iOS 12 or greater.
Declaration
public static bool worldMapSupported { get; }
Property Value
See Also
worldMappingStatus
Get the world mapping status. Used to determine the suitability of the current session for
creating an ARWorld
Declaration
public ARWorldMappingStatus worldMappingStatus { get; }
Property Value
Type | Description |
---|---|
ARWorld |
The ARWorld |
Methods
ApplyWorldMap(ARWorldMap)
Applies an ARWorld
Declaration
public void ApplyWorldMap(ARWorldMap worldMap)
Parameters
Type | Name | Description |
---|---|---|
ARWorld |
worldMap | An ARWorld |
Remarks
This attempts to relocalize the current session to the given worldMap
. If
relocalization is successful, the stored planes and anchors from the worldMap
are
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
.
DequeueCollaborationData()
Dequeues the oldest collaboration data in the queue. After calling this method, collaboration
Declaration
public ARCollaborationData DequeueCollaborationData()
Returns
Type | Description |
---|---|
ARCollaboration |
The nextx ARCollaboration |
Exceptions
Type | Condition |
---|---|
Not |
Thrown if supports |
Invalid |
Thrown if collaboration |
See Also
GetARWorldMapAsync()
Asynchronously create an ARWorldARWorldMap
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 |
---|---|
ARWorld |
An ARWorld |
See Also
GetARWorldMapAsync(Action<ARWorldMapRequestStatus, ARWorldMap>)
Asynchronously create an ARWorldARWorldMap
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 ARWorld
Declaration
public void GetARWorldMapAsync(Action<ARWorldMapRequestStatus, ARWorldMap> onComplete)
Parameters
Type | Name | Description |
---|---|---|
Action<ARWorld |
onComplete | A method to invoke when the world map has either been created, or if the
world map could not be created. Check the value of the ARWorld |
See Also
OnCreate()
Invoked when the subsystem is created.
Declaration
protected override void OnCreate()
Overrides
SetCoachingActive(bool, ARCoachingOverlayTransition)
Activates or deactivates the Coaching Overlay.
Declaration
public void SetCoachingActive(bool active, ARCoachingOverlayTransition transition)
Parameters
Type | Name | Description |
---|---|---|
bool | active | Whether the coaching overlay should be active. |
ARCoaching |
transition | The type of transition to use when showing or hiding the coaching overlay. |
UpdateWithCollaborationData(ARCollaborationData)
Applies ARCollaboration
Declaration
public void UpdateWithCollaborationData(ARCollaborationData collaborationData)
Parameters
Type | Name | Description |
---|---|---|
ARCollaboration |
collaborationData | The ARCollaboration |
Exceptions
Type | Condition |
---|---|
Not |
Thrown if supports |
Invalid |
Thrown if |