docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class GraphicsTestBuildSettings

    A class that holds settings for the Graphics Test Build.

    Inheritance
    object
    Object
    ScriptableObject
    GraphicsTestBuildSettings
    Implements
    ISerializationCallbackReceiver
    Inherited Members
    ScriptableObject.SetDirty()
    ScriptableObject.CreateInstance(string)
    ScriptableObject.CreateInstance(Type)
    ScriptableObject.CreateInstance<T>()
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(object)
    Object.InstantiateAsync<T>(T)
    Object.InstantiateAsync<T>(T, Transform)
    Object.InstantiateAsync<T>(T, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int)
    Object.InstantiateAsync<T>(T, int, Transform)
    Object.InstantiateAsync<T>(T, int, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>)
    Object.InstantiateAsync<T>(T, int, Transform, Vector3, Quaternion)
    Object.InstantiateAsync<T>(T, int, Transform, Vector3, Quaternion, CancellationToken)
    Object.InstantiateAsync<T>(T, int, Transform, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>)
    Object.InstantiateAsync<T>(T, int, Transform, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>, CancellationToken)
    Object.InstantiateAsync<T>(T, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, int, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, Vector3, Quaternion, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, int, Vector3, Quaternion, InstantiateParameters, CancellationToken)
    Object.InstantiateAsync<T>(T, int, ReadOnlySpan<Vector3>, ReadOnlySpan<Quaternion>, InstantiateParameters, CancellationToken)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Scene)
    Object.Instantiate<T>(T, InstantiateParameters)
    Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, bool)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, bool)
    Object.Destroy(Object, float)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, bool)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.FindObjectsOfType(Type, bool)
    Object.FindObjectsByType(Type, FindObjectsSortMode)
    Object.FindObjectsByType(Type, FindObjectsInactive, FindObjectsSortMode)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, float)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectsByType<T>(FindObjectsSortMode)
    Object.FindObjectsOfType<T>(bool)
    Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
    Object.FindObjectOfType<T>()
    Object.FindObjectOfType<T>(bool)
    Object.FindFirstObjectByType<T>()
    Object.FindAnyObjectByType<T>()
    Object.FindFirstObjectByType<T>(FindObjectsInactive)
    Object.FindAnyObjectByType<T>(FindObjectsInactive)
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.FindFirstObjectByType(Type)
    Object.FindAnyObjectByType(Type)
    Object.FindObjectOfType(Type, bool)
    Object.FindFirstObjectByType(Type, FindObjectsInactive)
    Object.FindAnyObjectByType(Type, FindObjectsInactive)
    Object.ToString()
    Object.name
    Object.hideFlags
    object.Equals(object, object)
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.TestTools.Graphics
    Assembly: UnityEngine.TestTools.Graphics.dll
    Syntax
    [Serializable]
    [CreateAssetMenu(fileName = "GraphicsTestBuildSettings.asset", menuName = "Graphics Test Framework/Graphics Test Build Settings")]
    public class GraphicsTestBuildSettings : ScriptableObject, ISerializationCallbackReceiver

    Constructors

    GraphicsTestBuildSettings()

    Constructor for the GraphicsTestBuildSettings class.

    Declaration
    public GraphicsTestBuildSettings()

    Fields

    k_EnableShaderStrippingArgument

    The CLI argument for enabling shader stripping. Used to override the EnableShaderStripping property.

    Declaration
    public const string k_EnableShaderStrippingArgument = "-enable-shader-stripping"
    Field Value
    Type Description
    string

    k_OverrideIgnoreAttributesArgument

    The CLI argument for overriding ignore attributes. Used to override the OverrideIgnoreAttributes property.

    Declaration
    public const string k_OverrideIgnoreAttributesArgument = "-override-ignore-attributes"
    Field Value
    Type Description
    string

    k_SaveActualImagesArgument

    The CLI argument for saving actual images. Used to override the SaveActualImages property.

    Declaration
    public const string k_SaveActualImagesArgument = "-save-actual-images"
    Field Value
    Type Description
    string

    k_ShaderWarningsAsErrorsArgument

    The CLI argument for shader warnings as errors. Used to override the ShaderWarningsAsErrors property.

    Declaration
    public const string k_ShaderWarningsAsErrorsArgument = "-shader-warnings-as-errors"
    Field Value
    Type Description
    string

    Properties

    ActualImagesPath

    The resolved path for actual/result images. Falls back to Assets/ActualImages when ImageResultsPath is empty.

    Declaration
    public string ActualImagesPath { get; }
    Property Value
    Type Description
    string

    AutoBuildTestCases

    A boolean that determines whether to automatically build test cases when building the player.

    Declaration
    public bool AutoBuildTestCases { get; set; }
    Property Value
    Type Description
    bool
    Remarks

    This is used to automatically build test cases when launching a test run.

    AutoOptimizeReferenceImages

    Optimize your reference images automatically when adding, removing or editing reference image files.

    Declaration
    public bool AutoOptimizeReferenceImages { get; set; }
    Property Value
    Type Description
    bool

    BuildPlatformNames

    The names of the platforms used in the most recent build.

    Declaration
    public string[] BuildPlatformNames { get; set; }
    Property Value
    Type Description
    string[]

    BuildPlatformSchemata

    The platform schemata used in the most recent build.

    Declaration
    public PlatformSchema[] BuildPlatformSchemata { get; set; }
    Property Value
    Type Description
    PlatformSchema[]

    EnableShaderStripping

    Whether to enable shader stripping in the build.

    Declaration
    public bool EnableShaderStripping { get; set; }
    Property Value
    Type Description
    bool

    HeatmapColorScheme

    The color scheme to use for visualizing the divergence among reference images.

    Declaration
    public HeatmapColorScheme HeatmapColorScheme { get; set; }
    Property Value
    Type Description
    HeatmapColorScheme

    ImageResultsPath

    The path to the image results.

    Declaration
    public string ImageResultsPath { get; set; }
    Property Value
    Type Description
    string

    MaxConcurrentImageOptimizations

    The maximum number of concurrent image optimizations that can be run at the same time.

    Declaration
    public int MaxConcurrentImageOptimizations { get; set; }
    Property Value
    Type Description
    int
    Remarks

    This is useful for limiting the number of concurrent optimizations to avoid overwhelming the system.

    OverrideIgnoreAttributes

    Whether to save actual images when running tests, even if they pass.

    Declaration
    public bool OverrideIgnoreAttributes { get; set; }
    Property Value
    Type Description
    bool

    PlatformSchemata

    The platform schemata to use in this project.

    Declaration
    public PlatformSchema[] PlatformSchemata { get; set; }
    Property Value
    Type Description
    PlatformSchema[]
    Remarks

    The schemata are resolved in sequence, meaning that test cases that have their test assets found using one schema will be skipped by latter schemata. It is recommended to order the schemata in order of specificity or priority.

    PreviousScenesEnabled

    The enabled states of the previous scenes. Used to restore the previous scenes after the build.

    Declaration
    public bool[] PreviousScenesEnabled { get; set; }
    Property Value
    Type Description
    bool[]

    PreviousScenesPaths

    The paths to the previous scenes. Used to restore the previous scenes after the build.

    Declaration
    public string[] PreviousScenesPaths { get; set; }
    Property Value
    Type Description
    string[]

    ReloadDomainWhenEditingTestSceneAssets

    Whether to use a file system watcher to automatically track changes in SceneGraphicsTestCase scene directories and trigger a domain reload after each change.

    Declaration
    public bool ReloadDomainWhenEditingTestSceneAssets { get; set; }
    Property Value
    Type Description
    bool

    SaveActualImages

    Whether to save actual images when running tests, even if they pass.

    Declaration
    public bool SaveActualImages { get; set; }
    Property Value
    Type Description
    bool

    SavePath

    The path to the GraphicsTestBuildSettings asset.

    Declaration
    public string SavePath { get; set; }
    Property Value
    Type Description
    string

    ShaderWarningsAsErrors

    When enabled, shader warnings detected during builds or test runs are treated as errors and will fail the job. Opt-in via the -shader-warnings-as-errors CLI flag.

    Declaration
    public bool ShaderWarningsAsErrors { get; set; }
    Property Value
    Type Description
    bool

    ShouldCleanUpAfterBuild

    A boolean that determines whether to clean up the Editor state after the build.

    Declaration
    public bool ShouldCleanUpAfterBuild { get; set; }
    Property Value
    Type Description
    bool

    TestContentBundlePaths

    The paths to the test content bundles included in the build.

    Declaration
    public string[] TestContentBundlePaths { get; set; }
    Property Value
    Type Description
    string[]
    Remarks

    The test content bundles are used to load test assets for the tests.

    Methods

    Create()

    Create a new GraphicsTestBuildSettings.

    Declaration
    public static GraphicsTestBuildSettings Create()
    Returns
    Type Description
    GraphicsTestBuildSettings

    The created GraphicsTestBuildSettings.

    Remarks

    This method will create a new GraphicsTestBuildSettings and set the name to the file name without extension.

    Load(string)

    Load the GraphicsTestBuildSettings from disk.

    Declaration
    public static GraphicsTestBuildSettings Load(string loadPath)
    Parameters
    Type Name Description
    string loadPath

    Asset path (editor) or Resources-relative path (runtime).

    Returns
    Type Description
    GraphicsTestBuildSettings

    The loaded settings, or null if the asset does not exist.

    LoadOrDefault()

    Returns the cached settings instance, loading from disk or creating defaults if needed.

    Declaration
    public static GraphicsTestBuildSettings LoadOrDefault()
    Returns
    Type Description
    GraphicsTestBuildSettings

    The cached or newly loaded settings instance.

    OnAfterDeserialize()

    Implement this callback to transform data back into runtime data types after an object is deserialized.

    Declaration
    public void OnAfterDeserialize()

    OnBeforeSerialize()

    Implement this callback to transform data into serializable data types immediately before an object is serialized.

    Declaration
    public void OnBeforeSerialize()

    Save()

    Save the GraphicsTestBuildSettings.

    Declaration
    public bool Save()
    Returns
    Type Description
    bool

    True if the save was successful, false otherwise.

    Remarks

    This method will save the GraphicsTestBuildSettings to the specified path. If the path does not exist, it will create the directory. If the path exists, it will mark the asset as dirty and save it.

    Implements

    ISerializationCallbackReceiver
    In This Article
    Back to top
    Copyright © 2026 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)