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 |
|
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 |
|
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 |
|
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 |
|
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 |
|
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 |
|
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 |
|
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 |
|
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 |
|
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 |
|
Type Parameters
Name | Description |
---|---|
T1 | The first type of results data to cache. |
T2 | The second type of results data to cache. |