Class XRMarkerBuilder
Defines a fluent API for constructing an XRMarker.
Inherited Members
Namespace: UnityEngine.XR.ARSubsystems
Assembly: Unity.XR.ARSubsystems.dll
Syntax
public class XRMarkerBuilder
Constructors
XRMarkerBuilder()
Construct an instance.
Declaration
public XRMarkerBuilder()
Methods
Build()
Build the output XRMarker using all this builder's input parameter values.
Declaration
public XRMarker Build()
Returns
| Type | Description |
|---|---|
| XRMarker | The built |
Reset()
Reset the instance to default values.
Declaration
public void Reset()
WithDataBuffer(XRSpatialBuffer)
Set the data buffer for built XrMarker instances.
Declaration
public XRMarkerBuilder WithDataBuffer(XRSpatialBuffer dataBuffer)
Parameters
| Type | Name | Description |
|---|---|---|
| XRSpatialBuffer | dataBuffer | The data buffer of the marker. |
Returns
| Type | Description |
|---|---|
| XRMarkerBuilder | This instance. |
WithMarkerId(uint)
Set the marker ID for built XRMarker instances.
Declaration
public XRMarkerBuilder WithMarkerId(uint markerId)
Parameters
| Type | Name | Description |
|---|---|---|
| uint | markerId | The ID of the marker. |
Returns
| Type | Description |
|---|---|
| XRMarkerBuilder | This instance. |
WithMarkerType(XRMarkerType)
Set the marker type for built XRMarker instances.
Declaration
public XRMarkerBuilder WithMarkerType(XRMarkerType markerType)
Parameters
| Type | Name | Description |
|---|---|---|
| XRMarkerType | markerType | The marker type of the marker. |
Returns
| Type | Description |
|---|---|
| XRMarkerBuilder | This instance. |
WithNativePtr(IntPtr)
Set the native pointer for built XRMarker instances.
Declaration
public XRMarkerBuilder WithNativePtr(IntPtr nativePtr)
Parameters
| Type | Name | Description |
|---|---|---|
| IntPtr | nativePtr | The native pointer. |
Returns
| Type | Description |
|---|---|
| XRMarkerBuilder | This instance. |
WithParentId(TrackableId)
Set the parent ID for built XRMarker instances.
Declaration
public XRMarkerBuilder WithParentId(TrackableId parentId)
Parameters
| Type | Name | Description |
|---|---|---|
| TrackableId | parentId | The parent ID. |
Returns
| Type | Description |
|---|---|
| XRMarkerBuilder | This instance. |
WithPose(Pose)
Set the pose for built XRMarker instances.
Declaration
public XRMarkerBuilder WithPose(Pose pose)
Parameters
| Type | Name | Description |
|---|---|---|
| Pose | pose | The Unity world space pose. |
Returns
| Type | Description |
|---|---|
| XRMarkerBuilder | This instance. |
WithSize(Vector2)
Set the size for built XRMarker instances.
Declaration
public XRMarkerBuilder WithSize(Vector2 size)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | size | The size of the marker. |
Returns
| Type | Description |
|---|---|
| XRMarkerBuilder | This instance. |
WithTrackableId(TrackableId)
Set the trackable ID for built XRMarker instances.
Declaration
public XRMarkerBuilder WithTrackableId(TrackableId trackableId)
Parameters
| Type | Name | Description |
|---|---|---|
| TrackableId | trackableId | The trackable ID. |
Returns
| Type | Description |
|---|---|
| XRMarkerBuilder | This instance. |
WithTrackingState(TrackingState)
Set the tracking state for built XRMarker instances.
Declaration
public XRMarkerBuilder WithTrackingState(TrackingState trackingState)
Parameters
| Type | Name | Description |
|---|---|---|
| TrackingState | trackingState | The tracking state. |
Returns
| Type | Description |
|---|---|
| XRMarkerBuilder | This instance. |