Class XRAnchorSubsystem.Provider
An interface to be implemented by providers of this subsystem.
Namespace: UnityEngine.XR.ARSubsystems
Syntax
protected abstract class Provider
Methods
Destroy()
Called when Destroy
is called on the subsystem.
Declaration
public virtual void Destroy()
GetChanges(XRAnchor, Allocator)
Invoked to get the changes to anchors (added, updated, and removed) since the last call to
Declaration
public abstract TrackableChanges<XRAnchor> GetChanges(XRAnchor defaultAnchor, Allocator allocator)
Parameters
Type | Name | Description |
---|---|---|
XRAnchor | defaultAnchor | The default anchor. This should be used to initialize the returned
|
Allocator | allocator | An allocator to use for the |
Returns
Type | Description |
---|---|
TrackableChanges<XRAnchor> | Changes since the last call to GetChanges(XRAnchor, Allocator). |
Start()
Invoked when Start
is called on the subsystem. This method is only called if the subsystem was not previously running.
Declaration
public virtual void Start()
Stop()
Invoked when Stop
is called on the subsystem. This method is only called if the subsystem was previously running.
Declaration
public virtual void Stop()
TryAddAnchor(Pose, out XRAnchor)
Should create a new anchor with the provide pose
.
Declaration
public virtual bool TryAddAnchor(Pose pose, out XRAnchor anchor)
Parameters
Type | Name | Description |
---|---|---|
Pose | pose | The pose, in session space, of the new anchor. |
XRAnchor | anchor | The new anchor. Must be valid only if this method returns |
Returns
Type | Description |
---|---|
Boolean | Should return |
TryAttachAnchor(TrackableId, Pose, out XRAnchor)
Should create a new anchor "attached" to the trackable with id trackableToAffix
.
The behavior of the anchor depends on the type of trackable to which this anchor is attached and
may be implemenation-defined.
Declaration
public virtual bool TryAttachAnchor(TrackableId trackableToAffix, Pose pose, out XRAnchor anchor)
Parameters
Type | Name | Description |
---|---|---|
TrackableId | trackableToAffix | The id of the trackable to which to attach. |
Pose | pose | The pose, in session space, of the anchor to create. |
XRAnchor | anchor | The new anchor. Must be valid only if this method returns |
Returns
Type | Description |
---|---|
Boolean |
|
TryRemoveAnchor(TrackableId)
Should remove an existing anchor with TrackableId anchorId
.
Declaration
public virtual bool TryRemoveAnchor(TrackableId anchorId)
Parameters
Type | Name | Description |
---|---|---|
TrackableId | anchorId | The id of an existing anchor to remove. |
Returns
Type | Description |
---|---|
Boolean | Should return |