Assets
public static class AssetsNo description is available for this type.
Methods
Section titled “Methods”
Extract(Asset, AssetFile, bool, CancellationToken)
Section titled “Extract(Asset, AssetFile, bool, CancellationToken)”public static Task<string> Extract(Asset asset, AssetFile assetFile = null, bool fileOnly = false, CancellationToken ct = default)Extracts an asset from its archive to the materialized cache folder.
Parameters
| Name | Type | Description |
|---|---|---|
asset |
AssetInventory.Asset | |
assetFile |
AssetInventory.AssetFile | |
fileOnly |
System.Boolean | |
ct |
System.Threading.CancellationToken |
Returns
System.Threading.Tasks.Task{System.String} — No return description is available.
IsMaterialized(Asset, AssetFile)
Section titled “IsMaterialized(Asset, AssetFile)”public static bool IsMaterialized(Asset asset, AssetFile assetFile = null)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
asset |
AssetInventory.Asset | |
assetFile |
AssetInventory.AssetFile |
Returns
System.Boolean — No return description is available.
EnsureMaterialized(AssetInfo, bool, CancellationToken)
Section titled “EnsureMaterialized(AssetInfo, bool, CancellationToken)”public static Task<string> EnsureMaterialized(AssetInfo info, bool fileOnly = false, CancellationToken ct = default)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
info |
AssetInventory.AssetInfo | |
fileOnly |
System.Boolean | |
ct |
System.Threading.CancellationToken |
Returns
System.Threading.Tasks.Task{System.String} — No return description is available.
EnsureMaterialized(Asset, AssetFile, bool, CancellationToken)
Section titled “EnsureMaterialized(Asset, AssetFile, bool, CancellationToken)”public static Task<string> EnsureMaterialized(Asset asset, AssetFile assetFile = null, bool fileOnly = false, CancellationToken ct = default)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
asset |
AssetInventory.Asset | |
assetFile |
AssetInventory.AssetFile | |
fileOnly |
System.Boolean | |
ct |
System.Threading.CancellationToken |
Returns
System.Threading.Tasks.Task{System.String} — No return description is available.
Load()
Section titled “Load()”public static List<AssetInfo> Load()No description is available for this member.
Returns
System.Collections.Generic.List{AssetInventory.AssetInfo} — No return description is available.
CopyTo(AssetInfo, string, bool, int, bool, bool, bool, bool)
Section titled “CopyTo(AssetInfo, string, bool, int, bool, bool, bool, bool)”public static Task<string> CopyTo(AssetInfo info, string folder, bool withDependencies = false, int scriptMode = 0, bool fromDragDrop = false, bool outOfProject = false, bool reimport = false, bool previewMode = false)Copies an asset file to a destination folder, optionally including dependencies. Uses batched processing to minimize AssetDatabase.Refresh() calls and handles parallel execution safely via CopyCoordinator.
Parameters
| Name | Type | Description |
|---|---|---|
info |
AssetInventory.AssetInfo | |
folder |
System.String | |
withDependencies |
System.Boolean | |
scriptMode |
System.Int32 | |
fromDragDrop |
System.Boolean | |
outOfProject |
System.Boolean | |
reimport |
System.Boolean | |
previewMode |
System.Boolean |
Returns
System.Threading.Tasks.Task{System.String} — No return description is available.
CopyToBatch(List, string, bool, bool)
Section titled “CopyToBatch(List, string, bool, bool)”public static Task<Dictionary<int, string>> CopyToBatch(List<AssetInfo> infos, string folder, bool withDependencies, bool previewMode)Copies multiple asset files and their dependencies to a destination folder in a single batch. This dramatically reduces AssetDatabase.Refresh() calls by batching all files together. Used for bulk preview generation where many files from the same package need to be materialized.
Parameters
| Name | Type | Description |
|---|---|---|
infos |
System.Collections.Generic.List{AssetInventory.AssetInfo} | List of assets to copy |
folder |
System.String | Target folder (typically the preview work folder) |
withDependencies |
System.Boolean | Whether to include dependencies |
previewMode |
System.Boolean | Whether this is for preview generation (affects GUID reuse behavior) |
Returns
System.Threading.Tasks.Task{System.Collections.Generic.Dictionary{System.Int32,System.String}} — Dictionary mapping AssetInfo.Id to the project-relative path of the copied file
RunURPConverter()
Section titled “RunURPConverter()”public static bool RunURPConverter()Runs the URP material converter if available (fire-and-forget).
Returns
System.Boolean — True if the Unity converter ran without error, false otherwise.
RunURPConverterAsync()
Section titled “RunURPConverterAsync()”public static Task<bool> RunURPConverterAsync()Runs the URP material converter and waits for it to complete.
Returns
System.Threading.Tasks.Task{System.Boolean} — True if the Unity converter ran successfully, false otherwise.
ConvertImportedMaterialsToPipeline(IEnumerable)
Section titled “ConvertImportedMaterialsToPipeline(IEnumerable)”public static void ConvertImportedMaterialsToPipeline(IEnumerable<string> importedPaths)Converts material assets at the given project-relative paths from BIRP to the current render pipeline.
Parameters
| Name | Type | Description |
|---|---|---|
importedPaths |
System.Collections.Generic.IEnumerable{System.String} | |
ConvertAllProjectMaterialsToPipeline()
Section titled “ConvertAllProjectMaterialsToPipeline()”public static void ConvertAllProjectMaterialsToPipeline()Scans all materials in the project and converts any remaining BIRP materials to the current render pipeline.
GetExistingAssetPathForGuid(string, bool, bool)
Section titled “GetExistingAssetPathForGuid(string, bool, bool)”public static string GetExistingAssetPathForGuid(string guid, bool previewMode, bool validateLoadable = false)Checks if a file with the given GUID already exists in the project.
Parameters
| Name | Type | Description |
|---|---|---|
guid |
System.String | The GUID to check |
previewMode |
System.Boolean | If true, includes temp/preview folders; if false, excludes them |
validateLoadable |
System.Boolean |
Returns
System.String — The existing asset path if found and should be reused, null otherwise
ForgetAssetFile(AssetFile)
Section titled “ForgetAssetFile(AssetFile)”public static void ForgetAssetFile(AssetFile info)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
info |
AssetInventory.AssetFile | |
SetFilesHidden(List, bool)
Section titled “SetFilesHidden(List, bool)”public static void SetFilesHidden(List<int> fileIds, bool hidden)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
fileIds |
System.Collections.Generic.List{System.Int32} | |
hidden |
System.Boolean | |
GetHiddenPaths(int)
Section titled “GetHiddenPaths(int)”public static List<string> GetHiddenPaths(int assetId)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
assetId |
System.Int32 |
Returns
System.Collections.Generic.List{System.String} — No return description is available.
RestoreHiddenPaths(int, List)
Section titled “RestoreHiddenPaths(int, List)”public static void RestoreHiddenPaths(int assetId, List<string> paths)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
assetId |
System.Int32 | |
paths |
System.Collections.Generic.List{System.String} | |
ApplyHidePatterns(int)
Section titled “ApplyHidePatterns(int)”public static void ApplyHidePatterns(int assetId)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
assetId |
System.Int32 | |
ForgetPackage(AssetInfo, bool, bool)
Section titled “ForgetPackage(AssetInfo, bool, bool)”public static Asset ForgetPackage(AssetInfo info, bool removeExclusion = false, bool removeFiles = false)Resets a package to “new” state for reindexing.
Parameters
| Name | Type | Description |
|---|---|---|
info |
AssetInventory.AssetInfo | |
removeExclusion |
System.Boolean | |
removeFiles |
System.Boolean |
Returns
AssetInventory.Asset — No return description is available.
RemovePackage(AssetInfo, bool)
Section titled “RemovePackage(AssetInfo, bool)”public static void RemovePackage(AssetInfo info, bool deleteFiles)Completely removes a package and all its data from the database.
Parameters
| Name | Type | Description |
|---|---|---|
info |
AssetInventory.AssetInfo | |
deleteFiles |
System.Boolean | |
CountPurchasedAssets(IEnumerable)
Section titled “CountPurchasedAssets(IEnumerable)”public static int CountPurchasedAssets(IEnumerable<AssetInfo> assets)Counts the number of purchased assets in the list.
Parameters
| Name | Type | Description |
|---|---|---|
assets |
System.Collections.Generic.IEnumerable{AssetInventory.AssetInfo} |
Returns
System.Int32 — No return description is available.
PlayAudio(AssetInfo, CancellationToken)
Section titled “PlayAudio(AssetInfo, CancellationToken)”public static Task PlayAudio(AssetInfo info, CancellationToken ct = default)Plays an audio file from an asset, extracting it if necessary.
Parameters
| Name | Type | Description |
|---|---|---|
info |
AssetInventory.AssetInfo | The asset info containing the audio file |
ct |
System.Threading.CancellationToken | Cancellation token for async operations |
Returns
System.Threading.Tasks.Task — No return description is available.
GetPackage(int)
Section titled “GetPackage(int)”public static AssetInfo GetPackage(int packageId)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
packageId |
System.Int32 |
Returns
AssetInventory.AssetInfo — No return description is available.
DownloadPackageAsync(AssetInfo, CancellationToken)
Section titled “DownloadPackageAsync(AssetInfo, CancellationToken)”public static Task<bool> DownloadPackageAsync(AssetInfo info, CancellationToken ct = default)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
info |
AssetInventory.AssetInfo | |
ct |
System.Threading.CancellationToken |
Returns
System.Threading.Tasks.Task{System.Boolean} — No return description is available.
GetInventoryStats()
Section titled “GetInventoryStats()”public static InventoryStats GetInventoryStats()No description is available for this member.
Returns
AssetInventory.InventoryStats — No return description is available.
LoadPackagesForExport(string, HashSet)
Section titled “LoadPackagesForExport(string, HashSet)”public static List<AssetInfo> LoadPackagesForExport(string searchQuery = null, HashSet<int> packageIdFilter = null)No description is available for this member.
Parameters
| Name | Type | Description |
|---|---|---|
searchQuery |
System.String | |
packageIdFilter |
System.Collections.Generic.HashSet{System.Int32} |
Returns
System.Collections.Generic.List{AssetInventory.AssetInfo} — No return description is available.