PackageImporter
public sealed class PackageImporter : AssetImporterImporter for discovering, indexing, and persisting package content in the Asset Inventory catalog.
Methods
Section titled “Methods”
IndexRough(string, bool)
Section titled “IndexRough(string, bool)”public Task IndexRough(string path, bool fromAssetStore)Reads a package.json file and creates or refreshes the corresponding registry-package catalog record.
Parameters
| Name | Type |
|---|---|
path |
System.String |
fromAssetStore |
System.Boolean |
Returns
System.Threading.Tasks.Task
ApplyTags(Asset, Package, bool)
Section titled “ApplyTags(Asset, Package, bool)”public static bool ApplyTags(Asset asset, Package info, bool fromAssetStore)Applies package-manager keywords and configured source tags to the supplied catalog package.
Parameters
| Name | Type |
|---|---|
asset |
AssetInventory.Asset |
info |
AssetInventory.Package |
fromAssetStore |
System.Boolean |
Returns
System.Boolean
CreateAsset(Package, string, PackageSource)
Section titled “CreateAsset(Package, string, PackageSource)”public static Task<Asset> CreateAsset(Package info, string package, PackageSource source)Creates and persists a catalog package record from parsed registry package metadata and its package source.
Parameters
| Name | Type |
|---|---|
info |
AssetInventory.Package |
package |
System.String |
source |
UnityEditor.PackageManager.PackageSource |
Returns
System.Threading.Tasks.Task{AssetInventory.Asset}
IndexDetails(int)
Section titled “IndexDetails(int)”public Task IndexDetails(int assetId = 0)Refreshes dependency, sample, repository, author, version, and file metadata for one or all registry packages.
Parameters
| Name | Type |
|---|---|
assetId |
System.Int32 |
Returns
System.Threading.Tasks.Task
ReadPackageFile(string)
Section titled “ReadPackageFile(string)”public static Package ReadPackageFile(string package)Parses package.json from the supplied package directory, returning null when the descriptor cannot be read.
Parameters
| Name | Type |
|---|---|
package |
System.String |
Returns
AssetInventory.Package
Persist(PackageInfo)
Section titled “Persist(PackageInfo)”public static bool Persist(PackageInfo package)Creates or updates the catalog record for an installed Unity Package Manager package.
Parameters
| Name | Type |
|---|---|
package |
UnityEditor.PackageManager.PackageInfo |
Returns
System.Boolean
Constructors
Section titled “Constructors”
PackageImporter()
Section titled “PackageImporter()”public PackageImporter()