Class BuildCache | Scriptable Build Pipeline | 1.5.10
docs.unity3d.com
    Show / Hide Table of Contents

    Class BuildCache

    Default implementation of the Build Cache

    Inheritance
    Object
    BuildCache
    Namespace: UnityEditor.Build.Pipeline.Utilities
    Syntax
    public class BuildCache : IBuildCache, IContextObject, IDisposable

    Constructors

    BuildCache()

    Declaration
    public BuildCache()

    BuildCache(String, Int32)

    Declaration
    public BuildCache(string host, int port = 8126)
    Parameters
    Type Name Description
    String host
    Int32 port

    Methods

    Dispose()

    Declaration
    public void Dispose()

    GetCachedArtifactsDirectory(CacheEntry)

    Returns the path where artifact data can be saved in the cache

    Declaration
    public string GetCachedArtifactsDirectory(CacheEntry entry)
    Parameters
    Type Name Description
    CacheEntry entry

    Cache entry to get the path

    Returns
    Type Description
    String

    Path on disk where to save cached artifacts

    Implements
    IBuildCache.GetCachedArtifactsDirectory(CacheEntry)

    GetCachedInfoFile(CacheEntry)

    Returns the path where info data can be saved in the cache

    Declaration
    public string GetCachedInfoFile(CacheEntry entry)
    Parameters
    Type Name Description
    CacheEntry entry

    Cache entry to get the path

    Returns
    Type Description
    String

    Path on disk where to save cached info

    Implements
    IBuildCache.GetCachedInfoFile(CacheEntry)

    GetCacheEntry(GUID, Int32)

    Gets a CacheEntry for an asset identified by its GUID.

    Declaration
    public CacheEntry GetCacheEntry(GUID asset, int version = 1)
    Parameters
    Type Name Description
    GUID asset

    GUID identifier for an asset from the Asset Database

    Int32 version

    Version number of the system asking for an entry to distinguish it from previous incompatible entries. (Optional)

    Returns
    Type Description
    CacheEntry

    CacheEntry representing current asset.

    Implements
    IBuildCache.GetCacheEntry(GUID, Int32)

    GetCacheEntry(ObjectIdentifier, Int32)

    Gets a CacheEntry for an object identified by an Object Identifier.

    Declaration
    public CacheEntry GetCacheEntry(ObjectIdentifier objectID, int version = 1)
    Parameters
    Type Name Description
    ObjectIdentifier objectID

    Object identifier for an object

    Int32 version

    Version number of the system asking for an entry to distinguish it from previous incompatible entries. (Optional)

    Returns
    Type Description
    CacheEntry

    CacheEntry representing an object identifier.

    Implements
    IBuildCache.GetCacheEntry(ObjectIdentifier, Int32)

    GetCacheEntry(String, Int32)

    Gets a CacheEntry for a file identified by its relative path.

    Declaration
    public CacheEntry GetCacheEntry(string path, int version = 1)
    Parameters
    Type Name Description
    String path

    Relative path of a file on disk

    Int32 version

    Version number of the system asking for an entry to distinguish it from previous incompatible entries. (Optional)

    Returns
    Type Description
    CacheEntry

    CacheEntry representing a file on disk.

    Implements
    IBuildCache.GetCacheEntry(String, Int32)

    HasAssetOrDependencyChanged(CachedInfo)

    Checks if the CachedInfo passed in needs to be rebuilt

    Declaration
    public bool HasAssetOrDependencyChanged(CachedInfo info)
    Parameters
    Type Name Description
    CachedInfo info

    Cached Info to check

    Returns
    Type Description
    Boolean

    true if the cached info needs to be rebuilt; otherwise, false.

    Implements
    IBuildCache.HasAssetOrDependencyChanged(CachedInfo)

    LoadCachedData(IList<CacheEntry>, out IList<CachedInfo>)

    Loads a set of CachedInfos from the cache

    Declaration
    public void LoadCachedData(IList<CacheEntry> entries, out IList<CachedInfo> cachedInfos)
    Parameters
    Type Name Description
    IList<CacheEntry> entries

    List of cache entries to load

    IList<CachedInfo> cachedInfos

    Out list of cached infos loaded

    Implements
    IBuildCache.LoadCachedData(IList<CacheEntry>, out IList<CachedInfo>)

    PruneCache()

    Declaration
    public static void PruneCache()

    PruneCache_Background(Int64)

    Declaration
    public static void PruneCache_Background(long maximumCacheSize)
    Parameters
    Type Name Description
    Int64 maximumCacheSize

    PurgeCache(Boolean)

    Declaration
    public static void PurgeCache(bool prompt)
    Parameters
    Type Name Description
    Boolean prompt

    SaveCachedData(IList<CachedInfo>)

    Saves a set of CachedInfos to the cache

    Declaration
    public void SaveCachedData(IList<CachedInfo> infos)
    Parameters
    Type Name Description
    IList<CachedInfo> infos

    List of cached infos to save

    Implements
    IBuildCache.SaveCachedData(IList<CachedInfo>)
    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