Class XRTrackedImageBuilder
Defines a fluent API for constructing an XRTrackedImage.
Inherited Members
Namespace: UnityEngine.XR.ARSubsystems
Assembly: Unity.XR.ARSubsystems.dll
Syntax
public class XRTrackedImageBuilder
Constructors
XRTrackedImageBuilder()
Construct an instance.
Declaration
public XRTrackedImageBuilder()
Methods
Build()
Build an output XRTrackedImage using all this builder's parameter values.
Declaration
public XRTrackedImage Build()
Returns
| Type | Description |
|---|---|
| XRTrackedImage | The built |
FromTrackedImage(XRTrackedImage)
Initialize all fields using data from the given tracked image.
Declaration
public XRTrackedImageBuilder FromTrackedImage(XRTrackedImage trackedImage)
Parameters
| Type | Name | Description |
|---|---|---|
| XRTrackedImage | trackedImage | The tracked image. |
Returns
| Type | Description |
|---|---|
| XRTrackedImageBuilder | This instance. |
Reset()
Reset the instance to default values.
Declaration
public void Reset()
WithNativePtr(IntPtr)
Set the native pointer for built XRTrackedImage instances.
Declaration
public XRTrackedImageBuilder WithNativePtr(IntPtr nativePtr)
Parameters
| Type | Name | Description |
|---|---|---|
| IntPtr | nativePtr | The native pointer. |
Returns
| Type | Description |
|---|---|
| XRTrackedImageBuilder | This instance. |
WithParentId(TrackableId)
Set the parent ID for built XRTrackedImage instances.
Declaration
public XRTrackedImageBuilder WithParentId(TrackableId parentId)
Parameters
| Type | Name | Description |
|---|---|---|
| TrackableId | parentId | The parent ID. |
Returns
| Type | Description |
|---|---|
| XRTrackedImageBuilder | This instance. |
WithPose(Pose)
Set the pose for built XRTrackedImage instances.
Declaration
public XRTrackedImageBuilder WithPose(Pose pose)
Parameters
| Type | Name | Description |
|---|---|---|
| Pose | pose | The pose. |
Returns
| Type | Description |
|---|---|
| XRTrackedImageBuilder | This instance. |
WithSize(Vector2)
Set the size for built XRTrackedImage instances.
Declaration
public XRTrackedImageBuilder WithSize(Vector2 size)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2 | size | The size, in meters, of the detected image. |
Returns
| Type | Description |
|---|---|
| XRTrackedImageBuilder | This instance. |
WithSourceImageId(Guid)
Set the source image ID for built XRTrackedImage instances.
Declaration
public XRTrackedImageBuilder WithSourceImageId(Guid sourceImageId)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | sourceImageId | The GUID of the reference image that this tracked image was detected from. |
Returns
| Type | Description |
|---|---|
| XRTrackedImageBuilder | This instance. |
WithTrackableId(TrackableId)
Set the trackable ID for built XRTrackedImage instances.
Declaration
public XRTrackedImageBuilder WithTrackableId(TrackableId trackableId)
Parameters
| Type | Name | Description |
|---|---|---|
| TrackableId | trackableId | The trackable ID. |
Returns
| Type | Description |
|---|---|
| XRTrackedImageBuilder | This instance. |
WithTrackingState(TrackingState)
Set the tracking state for built XRTrackedImage instances.
Declaration
public XRTrackedImageBuilder WithTrackingState(TrackingState trackingState)
Parameters
| Type | Name | Description |
|---|---|---|
| TrackingState | trackingState | The tracking state. |
Returns
| Type | Description |
|---|---|
| XRTrackedImageBuilder | This instance. |