DependencyResultCache
public sealed class DependencyResultCacheCache for dependency calculation results to avoid redundant traversal of the same dependency trees. When File A and File B both depend on Material C, Material C’s dependencies are only calculated once.
Methods
Section titled “Methods”
GetMaterializedPathKey(int, string, string)
Section titled “GetMaterializedPathKey(int, string, string)”public static string GetMaterializedPathKey(int assetId, string guid, string path = null)Generates a consistent cache key for materialized path storage. Format: “{assetId}{guid}” when GUID is available, or “path:{assetId}{path}” as fallback for files without GUIDs.
Parameters
| Name | Type | Description |
|---|---|---|
assetId |
System.Int32 | |
guid |
System.String | |
path |
System.String |
Returns
System.String — No return description is available.
GetMaterializedPathKey(AssetInfo)
Section titled “GetMaterializedPathKey(AssetInfo)”public static string GetMaterializedPathKey(AssetInfo info)Generates a consistent cache key for materialized path storage from AssetInfo. Uses GUID when available, falls back to Path for files without GUIDs.
Parameters
| Name | Type | Description |
|---|---|---|
info |
AssetInventory.AssetInfo |
Returns
System.String — No return description is available.
GetMaterializedPathKey(int, AssetFile)
Section titled “GetMaterializedPathKey(int, AssetFile)”public static string GetMaterializedPathKey(int assetId, AssetFile file)Generates a consistent cache key for materialized path storage from AssetFile. Uses GUID when available, falls back to Path for files without GUIDs.
Parameters
| Name | Type | Description |
|---|---|---|
assetId |
System.Int32 | |
file |
AssetInventory.AssetFile |
Returns
System.String — No return description is available.
TryGetDependencies(int, string, out CachedDependencyResult)
Section titled “TryGetDependencies(int, string, out CachedDependencyResult)”public bool TryGetDependencies(int assetId, string guid, out DependencyResultCache.CachedDependencyResult result)Try to get cached dependency result for a file. Key is scoped by AssetId to prevent cross-package cache contamination when files share the same GUID across different packages.
Parameters
| Name | Type | Description |
|---|---|---|
assetId |
System.Int32 | |
guid |
System.String | |
result |
AssetInventory.DependencyResultCache.CachedDependencyResult |
Returns
System.Boolean — No return description is available.
StoreDependencies(int, string, CachedDependencyResult)
Section titled “StoreDependencies(int, string, CachedDependencyResult)”public void StoreDependencies(int assetId, string guid, DependencyResultCache.CachedDependencyResult result)Store dependency calculation result for a file. Key is scoped by AssetId to prevent cross-package cache contamination when files share the same GUID across different packages.
Parameters
| Name | Type | Description |
|---|---|---|
assetId |
System.Int32 | |
guid |
System.String | |
result |
AssetInventory.DependencyResultCache.CachedDependencyResult | |
PreloadPackageFiles(int, List)
Section titled “PreloadPackageFiles(int, List)”public void PreloadPackageFiles(int assetId, List<AssetFile> files)Pre-load all AssetFile records for a package to eliminate repeated DB queries
Parameters
| Name | Type | Description |
|---|---|---|
assetId |
System.Int32 | |
files |
System.Collections.Generic.List{AssetInventory.AssetFile} | |
TryGetAssetFile(int, string)
Section titled “TryGetAssetFile(int, string)”public AssetFile TryGetAssetFile(int assetId, string guid)Try to get AssetFile by GUID from pre-loaded package cache Returns null if not found or package not pre-loaded
Parameters
| Name | Type | Description |
|---|---|---|
assetId |
System.Int32 | |
guid |
System.String |
Returns
AssetInventory.AssetFile — No return description is available.
HasPackageCache(int)
Section titled “HasPackageCache(int)”public bool HasPackageCache(int assetId)Check if package files have been pre-loaded
Parameters
| Name | Type | Description |
|---|---|---|
assetId |
System.Int32 |
Returns
System.Boolean — No return description is available.
TryGetMaterializedPath(string, out string)
Section titled “TryGetMaterializedPath(string, out string)”public bool TryGetMaterializedPath(string key, out string path)Try to get cached materialized path
Parameters
| Name | Type | Description |
|---|---|---|
key |
System.String | |
path |
System.String |
Returns
System.Boolean — No return description is available.
StoreMaterializedPath(string, string)
Section titled “StoreMaterializedPath(string, string)”public void StoreMaterializedPath(string key, string path)Store materialized asset path
Parameters
| Name | Type | Description |
|---|---|---|
key |
System.String | |
path |
System.String | |
InvalidateMaterializedPath(string)
Section titled “InvalidateMaterializedPath(string)”public void InvalidateMaterializedPath(string key)Remove a cached materialized path entry, e.g. when validation discovers the import at that path is broken (missing nested prefab references).
Parameters
| Name | Type | Description |
|---|---|---|
key |
System.String | |
GetStatistics()
Section titled “GetStatistics()”public DependencyResultCache.CacheStatistics GetStatistics()Get cache statistics for debugging/logging
Returns
AssetInventory.DependencyResultCache.CacheStatistics — No return description is available.
Clear()
Section titled “Clear()”public void Clear()Clear all caches
Constructors
Section titled “Constructors”
DependencyResultCache()
Section titled “DependencyResultCache()”public DependencyResultCache()No description is available for this member.