Class ARWorldMapSessionExtensions
XRSessionSubsystem
extensions for interacting with ARWorldMaps.
Inheritance
Namespace: UnityEngine.XR.ARKit
Syntax
public static class ARWorldMapSessionExtensions
Methods
ApplyWorldMap(XRSessionSubsystem, ARWorldMap)
Declaration
public static void ApplyWorldMap(this XRSessionSubsystem sessionSubsystem, ARWorldMap worldMap)
Parameters
Type | Name | Description |
---|---|---|
XRSessionSubsystem | sessionSubsystem | |
ARWorldMap | worldMap |
GetARWorldMapAsync(XRSessionSubsystem)
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.
See also ApplyWorldMap(XRSessionSubsystem, ARWorldMap).
and WorldMapSupported(XRSessionSubsystem).
Declaration
public static ARWorldMapRequest GetARWorldMapAsync(this XRSessionSubsystem sessionSubsystem)
Parameters
Type | Name | Description |
---|---|---|
XRSessionSubsystem | sessionSubsystem | The |
Returns
Type | Description |
---|---|
ARWorldMapRequest | An ARWorldMapRequest which can be used to determine the status
of the request and get the |
GetARWorldMapAsync(XRSessionSubsystem, 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.
See also ApplyWorldMap(XRSessionSubsystem, ARWorldMap).
and WorldMapSupported(XRSessionSubsystem).
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 static void GetARWorldMapAsync(this XRSessionSubsystem sessionSubsystem, Action<ARWorldMapRequestStatus, ARWorldMap> onComplete)
Parameters
Type | Name | Description |
---|---|---|
XRSessionSubsystem | sessionSubsystem | The |
System.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. |
GetWorldMappingStatus(XRSessionSubsystem)
Get the world mapping status. Used to determine the suitability of the current session for creating an ARWorldMap.
Declaration
public static ARWorldMappingStatus GetWorldMappingStatus(this XRSessionSubsystem sessionSubsystem)
Parameters
Type | Name | Description |
---|---|---|
XRSessionSubsystem | sessionSubsystem | The |
Returns
Type | Description |
---|---|
ARWorldMappingStatus | The ARWorldMappingStatus of the session. |
WorldMapSupported(XRSessionSubsystem)
Detect ARWorldMap support. ARWorldMap
requires iOS 12 or greater.
See also GetARWorldMapAsync(XRSessionSubsystem).
Declaration
public static bool WorldMapSupported(this XRSessionSubsystem sessionSubsystem)
Parameters
Type | Name | Description |
---|---|---|
XRSessionSubsystem | sessionSubsystem | The |
Returns
Type | Description |
---|---|
System.Boolean |
|