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

NameType
assetPathSystem.String
recursiveSystem.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

NameType
targetPathSystem.String
onProgressSystem.Action{System.Int32,System.Int32}

Returns

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

FindReferencesAsync(string, Action<int, int>, CancellationToken)

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

Scans references to a project asset until complete or cancellation is requested.

Parameters

NameType
targetPathSystem.String
onProgressSystem.Action{System.Int32,System.Int32}
cancellationTokenSystem.Threading.CancellationToken

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

NameType
targetGuidsSystem.Collections.Generic.HashSet{System.String}
onProgressSystem.Action{System.Int32,System.Int32}

Returns

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

FindReferencesAsync(HashSet, Action<int, int>, CancellationToken)

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

Scans references to project asset GUIDs until complete or cancellation is requested.

Parameters

NameType
targetGuidsSystem.Collections.Generic.HashSet{System.String}
onProgressSystem.Action{System.Int32,System.Int32}
cancellationTokenSystem.Threading.CancellationToken

Returns

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