Class MetaOpenXRAnchorSubsystem
The Meta-OpenXR implementation of the XRAnchorSubsystem. Do not create this directly. Use the SubsystemManager instead.
Inheritance
Implements
Inherited Members
Namespace: UnityEngine.XR.OpenXR.Features.Meta
Assembly: Unity.XR.MetaOpenXR.dll
Syntax
[Preserve]
public sealed class MetaOpenXRAnchorSubsystem : XRAnchorSubsystem, ISubsystem
Properties
isSharedAnchorsSupported
Get whether shared anchors is supported by the OpenXR runtime.
Declaration
public Supported isSharedAnchorsSupported { get; }
Property Value
Type | Description |
---|---|
Supported |
|
sharedAnchorsGroupId
The group ID that anchors are shared with and loaded from.
Declaration
public SerializableGuid sharedAnchorsGroupId { get; set; }
Property Value
Type | Description |
---|---|
SerializableGuid |
Methods
TryLoadAllSharedAnchorsAsync(Allocator, Action<NativeArray<XRAnchor>>)
Attempts to load a batch of anchors that were shared with sharedAnchorsGroupId.
Declaration
public Awaitable<Result<NativeArray<XRAnchor>>> TryLoadAllSharedAnchorsAsync(Allocator allocator, Action<NativeArray<XRAnchor>> incrementalResultsCallback)
Parameters
Type | Name | Description |
---|---|---|
Allocator | allocator | The allocation strategy to use for the resulting |
Action<NativeArray<XRAnchor>> | incrementalResultsCallback | A callback method that will be called when any anchors are loaded.
This callback is invoked at least once if any anchors are successfully
loaded, and possibly multiple times before the async operation completes. Pass a |
Returns
Type | Description |
---|---|
Awaitable<Result<NativeArray<XRAnchor>>> | A |
Remarks
If no anchors were shared to the sharedAnchorsGroupId then this method will return 0 anchors and status.IsSuccess() will be true.
TryShareAnchorAsync(TrackableId)
Attempts to share an anchor so that it can be loaded by colocated users of your app. Notify colocated users of your app to load shared anchors from the sharedAnchorsGroupId. Once shared, anchors cannot be unshared. Shared anchors remain shared for 30 days until they expire.
Declaration
public Awaitable<XRResultStatus> TryShareAnchorAsync(TrackableId anchorId)
Parameters
Type | Name | Description |
---|---|---|
TrackableId | anchorId | The |
Returns
Type | Description |
---|---|
Awaitable<XRResultStatus> | The result of the async operation. You are responsible to await this result. |
TryShareAnchorsAsync(NativeArray<TrackableId>, Allocator)
Attempts to share a batch of anchors so that they can be loaded by colocated users of your app. Notify colocated users of your app to load shared anchors from the sharedAnchorsGroupId. Once shared, anchors cannot be unshared. Shared anchors remain shared for 30 days until they expire.
Declaration
public Awaitable<NativeArray<XRShareAnchorResult>> TryShareAnchorsAsync(NativeArray<TrackableId> anchorIds, Allocator allocator)
Parameters
Type | Name | Description |
---|---|---|
NativeArray<TrackableId> | anchorIds | The |
Allocator | allocator | The allocation strategy to use for the resulting |
Returns
Type | Description |
---|---|
Awaitable<NativeArray<XRShareAnchorResult>> | The result of the async operation, containing a |