Interface IBuildCache | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    Interface IBuildCache

    Base interface for the Build Caching

    Namespace: UnityEditor.Build.Pipeline.Interfaces
    Syntax
    public interface IBuildCache : IContextObject

    Methods

    GetArtifactCacheDirectory(CacheEntry)

    Returns the relative directory path where artifact data can be cached for a specified cacheEntry.

    Declaration
    string GetArtifactCacheDirectory(CacheEntry cacheEntry)
    Parameters
    Type Name Description
    CacheEntry cacheEntry

    Valid CacheEntry to get directory path.

    Returns
    Type Description
    System.String

    Relative directory path.

    GetCacheEntries(IEnumerable<GUID>, out HashSet<CacheEntry>)

    Generates a set of CacheEntries for the passed in assets.

    Declaration
    bool GetCacheEntries(IEnumerable<GUID> assets, out HashSet<CacheEntry> cacheEntries)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<GUID> assets

    The GUIDs that need cache entries.

    HashSet<CacheEntry> cacheEntries

    Out set of all cache entries.

    Returns
    Type Description
    System.Boolean

    true if all the assets have generated valid cache entries; otherwise, false.

    GetCacheEntry(GUID)

    Gets a CacheEntry for an asset identified by its GUID.

    Declaration
    CacheEntry GetCacheEntry(GUID asset)
    Parameters
    Type Name Description
    GUID asset

    GUID identifier for an asset from the Asset Database

    Returns
    Type Description
    CacheEntry

    CacheEntry representing current asset.

    GetDependencyCacheDirectory(CacheEntry)

    Returns the relative directory path where dependency data can be cached for a specified cacheEntry.

    Declaration
    string GetDependencyCacheDirectory(CacheEntry cacheEntry)
    Parameters
    Type Name Description
    CacheEntry cacheEntry

    Valid CacheEntry to get directory path.

    Returns
    Type Description
    System.String

    Relative directory path.

    IsCacheEntryValid(CacheEntry)

    Validates a cacheEntry and its dependencies.

    Declaration
    bool IsCacheEntryValid(CacheEntry cacheEntry)
    Parameters
    Type Name Description
    CacheEntry cacheEntry

    The entry in the cache to validate.

    Returns
    Type Description
    System.Boolean

    true if the cacheEntry is valid; otherwise, false.

    TryLoadFromCache(CacheEntry, ref AssetLoadInfo, ref BuildUsageTagSet)

    Tries to load from the cache generated dependency and usage data for a specified Assets's cacheEntry.

    Declaration
    bool TryLoadFromCache(CacheEntry cacheEntry, ref AssetLoadInfo info, ref BuildUsageTagSet usage)
    Parameters
    Type Name Description
    CacheEntry cacheEntry

    The entry to load dependency data.

    AssetLoadInfo info

    The Asset's generated dependency data to load. Parameter will not be chanced if data was unable to be loaded.

    BuildUsageTagSet usage

    The Asset's generated usage data to load. Parameter will not be chanced if data was unable to be loaded.

    Returns
    Type Description
    System.Boolean

    true if the cache was able to load the specified data; otherwise, false.

    TryLoadFromCache(CacheEntry, ref SceneDependencyInfo, ref BuildUsageTagSet)

    Tries to load from the cache generated dependency and usage data for a specified Scene's cacheEntry.

    Declaration
    bool TryLoadFromCache(CacheEntry cacheEntry, ref SceneDependencyInfo info, ref BuildUsageTagSet usage)
    Parameters
    Type Name Description
    CacheEntry cacheEntry

    The entry to load dependency data.

    SceneDependencyInfo info

    The Scene's generated dependency data to load.

    BuildUsageTagSet usage

    The Scene's generated usage data to load.

    Returns
    Type Description
    System.Boolean

    true if the cache was able to load the specified data; otherwise, false.

    TryLoadFromCache<T>(CacheEntry, ref T)

    Tries to load from the cache generated data for a specified cacheEntry.

    Declaration
    bool TryLoadFromCache<T>(CacheEntry cacheEntry, ref T results)
    Parameters
    Type Name Description
    CacheEntry cacheEntry

    The entry to load data.

    T results

    The generated data to load.

    Returns
    Type Description
    System.Boolean

    true if the cache was able to load the specified data; otherwise, false.

    Type Parameters
    Name Description
    T

    The type of results data to load.

    TryLoadFromCache<T1, T2>(CacheEntry, ref T1, ref T2)

    Tries to load from the cache generated data for a specified cacheEntry.

    Declaration
    bool TryLoadFromCache<T1, T2>(CacheEntry cacheEntry, ref T1 results1, ref T2 results2)
    Parameters
    Type Name Description
    CacheEntry cacheEntry

    The entry to load data.

    T1 results1

    The first generated data to load.

    T2 results2

    The second generated data to load.

    Returns
    Type Description
    System.Boolean

    true if the cache was able to load the specified data; otherwise, false.

    Type Parameters
    Name Description
    T1

    The first type of results data to load.

    T2

    The second type of results data to cache.

    TrySaveToCache(CacheEntry, AssetLoadInfo, BuildUsageTagSet)

    Tries to cache an Asset's cacheEntry and its generated dependency and usage data.

    Declaration
    bool TrySaveToCache(CacheEntry cacheEntry, AssetLoadInfo info, BuildUsageTagSet usage)
    Parameters
    Type Name Description
    CacheEntry cacheEntry

    The entry for caching dependency data.

    AssetLoadInfo info

    The Asset's generated dependency data to cache.

    BuildUsageTagSet usage

    The Asset's generated usage data to cache.

    Returns
    Type Description
    System.Boolean

    true if the cache was able to save the specified data; otherwise, false.

    TrySaveToCache(CacheEntry, SceneDependencyInfo, BuildUsageTagSet)

    Tries to cache a Scene's cacheEntry and its generated dependency and usage data.

    Declaration
    bool TrySaveToCache(CacheEntry cacheEntry, SceneDependencyInfo info, BuildUsageTagSet usage)
    Parameters
    Type Name Description
    CacheEntry cacheEntry

    The entry for caching dependency data.

    SceneDependencyInfo info

    The Scene's generated dependency data to cache.

    BuildUsageTagSet usage

    The Scene's generated usage data to cache.

    Returns
    Type Description
    System.Boolean

    true if the cache was able to save the specified data; otherwise, false.

    TrySaveToCache<T>(CacheEntry, T)

    Tries to cache generated data for the specified cacheEntry.

    Declaration
    bool TrySaveToCache<T>(CacheEntry cacheEntry, T results)
    Parameters
    Type Name Description
    CacheEntry cacheEntry

    The entry for caching data.

    T results

    The generated data to cache.

    Returns
    Type Description
    System.Boolean

    true if the cache was able to save the specified data; otherwise, false.

    Type Parameters
    Name Description
    T

    The type of results data to cache.

    TrySaveToCache<T1, T2>(CacheEntry, T1, T2)

    Tries to cache generated data for the specified cacheEntry.

    Declaration
    bool TrySaveToCache<T1, T2>(CacheEntry cacheEntry, T1 results1, T2 results2)
    Parameters
    Type Name Description
    CacheEntry cacheEntry

    The entry for caching data.

    T1 results1

    The first generated data to cache.

    T2 results2

    The second generated data to cache.

    Returns
    Type Description
    System.Boolean

    true if the cache was able to save the specified data; otherwise, false.

    Type Parameters
    Name Description
    T1

    The first type of results data to cache.

    T2

    The second type of results data to cache.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023