UnityPackageImporter
public sealed class UnityPackageImporter : AssetImporterImporter for discovering, indexing, and persisting unity package content in the Asset Inventory catalog.
Methods
Section titled “Methods”
IndexRoughLocal(FolderSpec, bool, bool)
Section titled “IndexRoughLocal(FolderSpec, bool, bool)”public Task IndexRoughLocal(FolderSpec spec, bool fromAssetStore, bool force = false)Discovers Unity package archives in the configured source and creates or refreshes their package records.
Parameters
| Name | Type |
|---|---|
spec |
AssetInventory.FolderSpec |
fromAssetStore |
System.Boolean |
force |
System.Boolean |
Returns
System.Threading.Tasks.Task
SetHeuristicPipelineCompatibility(Asset)
Section titled “SetHeuristicPipelineCompatibility(Asset)”public static void SetHeuristicPipelineCompatibility(Asset asset)Infers built-in, URP, and HDRP compatibility from the package name when explicit metadata is unavailable.
Parameters
| Name | Type |
|---|---|
asset |
AssetInventory.Asset |
TryParseSyntyFilename(string, out string, out string, out string, out string)
Section titled “TryParseSyntyFilename(string, out string, out string, out string, out string)”public static bool TryParseSyntyFilename(string filename, out string group, out string name, out string minVersion, out string version)Parses Synty package naming conventions into group, product name, minimum Unity version, and package version components.
Parameters
| Name | Type |
|---|---|
filename |
System.String |
group |
System.String |
name |
System.String |
minVersion |
System.String |
version |
System.String |
Returns
System.Boolean
ApplyHeader(AssetHeader, Asset)
Section titled “ApplyHeader(AssetHeader, Asset)”public static void ApplyHeader(AssetHeader header, Asset asset)Copies Asset Store identity, publisher, category, version, and compatibility metadata from a parsed package header.
Parameters
| Name | Type |
|---|---|
header |
AssetInventory.AssetHeader |
asset |
AssetInventory.Asset |
IndexDetails(int)
Section titled “IndexDetails(int)”public Task IndexDetails(int assetId = 0)Extracts and indexes files for one package or all pending Unity package records.
Parameters
| Name | Type |
|---|---|
assetId |
System.Int32 |
Returns
System.Threading.Tasks.Task
ProcessSubPackages(Asset, List)
Section titled “ProcessSubPackages(Asset, List)”public Task ProcessSubPackages(Asset asset, List<AssetFile> subPackages)Creates child package records for Unity packages or archives discovered inside the indexed parent package.
Parameters
| Name | Type |
|---|---|
asset |
AssetInventory.Asset |
subPackages |
System.Collections.Generic.List{AssetInventory.AssetFile} |
Returns
System.Threading.Tasks.Task
ReadHeader(string, bool)
Section titled “ReadHeader(string, bool)”public static AssetHeader ReadHeader(string path, bool fileExistsForSure = false)Reads Asset Store metadata from a Unity package header, returning null for missing or invalid archives.
Parameters
| Name | Type |
|---|---|
path |
System.String |
fileExistsForSure |
System.Boolean |
Returns
AssetInventory.AssetHeader
Constructors
Section titled “Constructors”
UnityPackageImporter()
Section titled “UnityPackageImporter()”public UnityPackageImporter()