docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class TestDataDescriptor

    Default ITestDataDescriptor implementation. Expands wildcard patterns of the form "Directory/*.ext" (top directory only) to concrete asset paths and addresses assets by their unchanged asset path. Subclass and override GetAssetPaths() to collect assets programmatically, or GetAddressableName(string) to define custom keys.

    Inheritance
    object
    TestDataDescriptor
    Implements
    ITestDataDescriptor
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.TestTools.Graphics
    Assembly: UnityEngine.TestTools.Graphics.dll
    Syntax
    public class TestDataDescriptor : ITestDataDescriptor

    Constructors

    TestDataDescriptor(string, IEnumerable<string>)

    Creates a descriptor for a set of test data assets.

    Declaration
    public TestDataDescriptor(string bundleName, IEnumerable<string> assetPatterns)
    Parameters
    Type Name Description
    string bundleName

    The logical bundle name; descriptors sharing a name are merged.

    IEnumerable<string> assetPatterns

    Asset paths or wildcard patterns, e.g. "Assets/Scenes/500_SSAO/*.exr".

    Properties

    AssetPatterns

    The declared asset paths or wildcard patterns, e.g. "Assets/Scenes/500_SSAO/*.exr".

    Declaration
    public IEnumerable<string> AssetPatterns { get; }
    Property Value
    Type Description
    IEnumerable<string>

    BundleName

    The logical bundle name: identical at build and run time, and descriptors sharing it merge into one bundle.

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

    Methods

    GetAddressableName(string)

    Maps a source asset path to the name used to address it in the bundle. The default implementation returns the asset path unchanged, which preserves AssetBundle's native addressing: assets load by full path or by file name. Override to define custom keys.

    Declaration
    public virtual string GetAddressableName(string assetPath)
    Parameters
    Type Name Description
    string assetPath

    The project-relative path of a declared asset.

    Returns
    Type Description
    string

    The addressable name for the asset.

    GetAssetPaths()

    Expands AssetPatterns to concrete project-relative asset paths. This runs where the project files exist (the Editor and the build machine); players never call it.

    Declaration
    public virtual IEnumerable<string> GetAssetPaths()
    Returns
    Type Description
    IEnumerable<string>

    The project-relative paths of every declared asset.

    Remarks

    Patterns containing '*' are expanded with GetFiles(string, string, SearchOption) over the pattern's directory (top directory only), skipping .meta files. Patterns without wildcards are returned when the file exists. Declarations that resolve to nothing are not reported here; the build fails on them so broken markup surfaces at build time.

    Implements

    ITestDataDescriptor
    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)