Class ReferenceImage
Represents a reference image to use for a test case.
Implements
Inherited Members
Namespace: UnityEngine.TestTools.Graphics
Assembly: UnityEngine.TestTools.Graphics.dll
Syntax
public sealed record ReferenceImage : IEquatable<ReferenceImage>
Constructors
ReferenceImage(string, TextureFormat, ImageExtension)
Creates a new reference image with the specified name, texture format, and extension.
Declaration
public ReferenceImage(string name, TextureFormat textureFormat = (TextureFormat)0, ImageExtension imageExtension = ImageExtension.PNG)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The name of the reference image. |
| TextureFormat | textureFormat | The type of texture to use for the reference image. |
| ImageExtension | imageExtension | The extension of the reference image. If not set, the default is PNG. |
Properties
AssetPath
The path to the reference image asset. (Editor only)
Declaration
public string AssetPath { get; }
Property Value
| Type | Description |
|---|---|
| string |
Image
The reference image texture to use for the test case.
Declaration
public Texture2D Image { get; }
Property Value
| Type | Description |
|---|---|
| Texture2D |
Remarks
This is the texture that will be used for the test case. It is loaded from the asset path and may be post-processed if necessary.
ImageExtension
The extension of the reference image. If not set, the default is PNG.
Declaration
public ImageExtension ImageExtension { get; }
Property Value
| Type | Description |
|---|---|
| ImageExtension |
Remarks
This is only used for the reference image asset path.
LoadMessage
The load message for the reference image, indicating any errors that occurred during loading.
Declaration
public string LoadMessage { get; }
Property Value
| Type | Description |
|---|---|
| string |
Name
The name of the reference image.
Declaration
public string Name { get; }
Property Value
| Type | Description |
|---|---|
| string |
TextureFormat
The type of texture to use for the reference image.
Declaration
public TextureFormat TextureFormat { get; }
Property Value
| Type | Description |
|---|---|
| TextureFormat |
Remarks
This is used to determine how the reference image is to be loaded and used.