Class XRAnchorBuilder
Defines a fluent API for constructing an XRAnchor.
Inherited Members
Namespace: UnityEngine.XR.ARSubsystems
Assembly: Unity.XR.ARSubsystems.dll
Syntax
public class XRAnchorBuilder
Constructors
XRAnchorBuilder()
Construct an instance.
Declaration
public XRAnchorBuilder()
Methods
Build()
Build the output XRAnchor using all this builder's input parameter values.
Declaration
public XRAnchor Build()
Returns
| Type | Description |
|---|---|
| XRAnchor | The built |
Reset()
Reset the instance to default values.
Declaration
public void Reset()
WithNativePtr(IntPtr)
Set the native pointer for built XRAnchor instances.
Declaration
public XRAnchorBuilder WithNativePtr(IntPtr nativePtr)
Parameters
| Type | Name | Description |
|---|---|---|
| IntPtr | nativePtr | The native pointer. |
Returns
| Type | Description |
|---|---|
| XRAnchorBuilder | This instance. |
WithParentId(TrackableId)
Set the parent ID for built XRAnchor instances.
Declaration
public XRAnchorBuilder WithParentId(TrackableId parentId)
Parameters
| Type | Name | Description |
|---|---|---|
| TrackableId | parentId | The parent ID. |
Returns
| Type | Description |
|---|---|
| XRAnchorBuilder | This instance. |
WithPose(Pose)
Set the pose for built XRAnchor instances.
Declaration
public XRAnchorBuilder WithPose(Pose pose)
Parameters
| Type | Name | Description |
|---|---|---|
| Pose | pose | The pose. |
Returns
| Type | Description |
|---|---|
| XRAnchorBuilder | This instance. |
WithSessionId(Guid)
Set the session ID for built XRAnchor instances.
Declaration
public XRAnchorBuilder WithSessionId(Guid sessionId)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | sessionId | The session ID. |
Returns
| Type | Description |
|---|---|
| XRAnchorBuilder | This instance. |
WithTrackableId(TrackableId)
Set the trackable ID for built XRAnchor instances.
Declaration
public XRAnchorBuilder WithTrackableId(TrackableId trackableId)
Parameters
| Type | Name | Description |
|---|---|---|
| TrackableId | trackableId | The trackable ID. |
Returns
| Type | Description |
|---|---|
| XRAnchorBuilder | This instance. |
WithTrackingState(TrackingState)
Set the tracking state for built XRAnchor instances.
Declaration
public XRAnchorBuilder WithTrackingState(TrackingState trackingState)
Parameters
| Type | Name | Description |
|---|---|---|
| TrackingState | trackingState | The tracking state. |
Returns
| Type | Description |
|---|---|
| XRAnchorBuilder | This instance. |