Skip to content

ProjectDependencyAnalysis

ClassAssetInventoryAssetInventory.Editor
public static class ProjectDependencyAnalysis

Scans serialized project assets for GUID references and resolves the files that depend on a selected project asset.

public static List<AssetFile> GetDependencies(string assetPath, bool recursive = true)

Returns GUIDs referenced by the supplied serialized project asset, optionally using a fresh file read instead of cached results.

Parameters

Name Type
assetPath System.String
recursive System.Boolean

Returns

System.Collections.Generic.List{AssetInventory.AssetFile}

FindReferencesAsync(string, Action<int, int>)

Section titled “FindReferencesAsync(string, Action<int, int>)”
public static Task<List<string>> FindReferencesAsync(string targetPath, Action<int, int> onProgress = null)

Scans serialized project assets and returns files containing any supplied target GUID, reporting progress while it runs.

Parameters

Name Type
targetPath System.String
onProgress System.Action{System.Int32,System.Int32}

Returns

System.Threading.Tasks.Task{System.Collections.Generic.List{System.String}}

FindReferencesAsync(HashSet, Action<int, int>)

Section titled “FindReferencesAsync(HashSet, Action<int, int>)”
public static Task<Dictionary<string, List<string>>> FindReferencesAsync(HashSet<string> targetGuids, Action<int, int> onProgress = null)

Scans serialized project assets and returns files containing any supplied target GUID, reporting progress while it runs.

Parameters

Name Type
targetGuids System.Collections.Generic.HashSet{System.String}
onProgress System.Action{System.Int32,System.Int32}

Returns

System.Threading.Tasks.Task{System.Collections.Generic.Dictionary{System.String,System.Collections.Generic.List{System.String}}}