Class XRReferenceImageBuilder
Defines a fluent API for constructing an XRReferenceImage.
Inherited Members
Namespace: UnityEngine.XR.ARSubsystems
Assembly: Unity.XR.ARSubsystems.dll
Syntax
public class XRReferenceImageBuilder
Constructors
XRReferenceImageBuilder()
Construct an instance.
Declaration
public XRReferenceImageBuilder()
Methods
Build()
Build an output XRReferenceImage using all this builder's parameter values.
Declaration
public XRReferenceImage Build()
Returns
| Type | Description |
|---|---|
| XRReferenceImage | The built |
FromReferenceImage(XRReferenceImage)
Initialize all fields using data from the given reference image.
Declaration
public XRReferenceImageBuilder FromReferenceImage(XRReferenceImage referenceImage)
Parameters
| Type | Name | Description |
|---|---|---|
| XRReferenceImage | referenceImage | The reference image. |
Returns
| Type | Description |
|---|---|
| XRReferenceImageBuilder | This instance. |
Reset()
Reset the instance to default values.
Declaration
public void Reset()
WithGuid(SerializableGuid)
Set the SerializableGuid for built XRReferenceImage instances.
Declaration
public XRReferenceImageBuilder WithGuid(SerializableGuid guid)
Parameters
| Type | Name | Description |
|---|---|---|
| SerializableGuid | guid | The SerializableGuid associated with the reference image. |
Returns
| Type | Description |
|---|---|
| XRReferenceImageBuilder | This instance. |
WithMovingImageType(MovingImageType)
Set the moving image type for built XRReferenceImage instances.
Declaration
public XRReferenceImageBuilder WithMovingImageType(MovingImageType movingImageType)
Parameters
| Type | Name | Description |
|---|---|---|
| MovingImageType | movingImageType | Indicates whether the image is expected to move in the real world. This overrides the moving image setting on the image library that contains it. |
Returns
| Type | Description |
|---|---|
| XRReferenceImageBuilder | This instance. |
WithName(string)
Set the name for built XRReferenceImage instances.
Declaration
public XRReferenceImageBuilder WithName(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | A name associated with the reference image. |
Returns
| Type | Description |
|---|---|
| XRReferenceImageBuilder | This instance. |
WithSize(Vector2?)
Set the physical size, in meters, for built XRReferenceImage instances.
Declaration
public XRReferenceImageBuilder WithSize(Vector2? size)
Parameters
| Type | Name | Description |
|---|---|---|
| Vector2? | size | The size of the image, in meters, or |
Returns
| Type | Description |
|---|---|
| XRReferenceImageBuilder | This instance. |
WithTexture(Texture2D)
Set the source texture for built XRReferenceImage instances.
Declaration
public XRReferenceImageBuilder WithTexture(Texture2D texture)
Parameters
| Type | Name | Description |
|---|---|---|
| Texture2D | texture | The source texture which the reference image represents. This can be |
Returns
| Type | Description |
|---|---|
| XRReferenceImageBuilder | This instance. |
WithTextureGuid(SerializableGuid)
Set the texture SerializableGuid for built XRReferenceImage instances.
Declaration
public XRReferenceImageBuilder WithTextureGuid(SerializableGuid textureGuid)
Parameters
| Type | Name | Description |
|---|---|---|
| SerializableGuid | textureGuid | The SerializableGuid of the source texture as it appears in the AssetDatabase in the Editor. |
Returns
| Type | Description |
|---|---|
| XRReferenceImageBuilder | This instance. |