Skip to content

Asset

ClassAssetInventoryAssetInventory.Editor
public sealed class Asset

Persistent package or source record containing identity, location, version, compatibility, licensing, and indexing state.

public const string NONE = "-no attached package-"

Returns

System.String

public const string UNITY_REGISTRY = "Unity"

Returns

System.String

public const char SUB_PATH = '|'

Returns

System.Char

public Asset()

public Asset(Package package)

Creates a persistent catalog package record from Unity registry or Package Manager metadata.

Parameters

Name Type
package AssetInventory.Package
public Asset(PackageInfo package)

Creates a persistent catalog package record from Unity registry or Package Manager metadata.

Parameters

Name Type
package UnityEditor.PackageManager.PackageInfo

public string GetLocation(bool expanded)

Resolves the package’s current source or extracted location, optionally preferring overrides and verifying that it exists.

Parameters

Name Type
expanded System.Boolean

Returns

System.String

public Task<string> GetLocation(bool expanded, bool resolveParent)

Resolves the package’s current source or extracted location, optionally preferring overrides and verifying that it exists.

Parameters

Name Type
expanded System.Boolean
resolveParent System.Boolean

Returns

System.Threading.Tasks.Task{System.String}

public string GetPreviewFile(string previewFolder, bool validate = true)

Returns the expected package preview path, optionally requiring the file to exist.

Parameters

Name Type
previewFolder System.String
validate System.Boolean

Returns

System.String

public string GetMediaFile(AssetMedia media, string previewFolder, bool validate = true)

Returns the resolved path for a package media record and optional requested variant.

Parameters

Name Type
media AssetInventory.AssetMedia
previewFolder System.String
validate System.Boolean

Returns

System.String

GetMediaThumbnailFile(AssetMedia, string, bool)

Section titled “GetMediaThumbnailFile(AssetMedia, string, bool)”
public string GetMediaThumbnailFile(AssetMedia media, string previewFolder, bool validate = true)

Returns the resolved thumbnail path for a package media record and optional requested variant.

Parameters

Name Type
media AssetInventory.AssetMedia
previewFolder System.String
validate System.Boolean

Returns

System.String

public List<Asset> GetChildren()

Loads direct child package records from the active catalog.

Returns

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

public object GetUnityAssetOrigin()

Returns Unity package-manager origin metadata when the record represents an installed package.

Returns

System.Object

public AssetOrigin GetAssetOrigin()

Returns the normalized catalog origin describing how this package was discovered.

Returns

AssetInventory.AssetOrigin

public Asset GetRootAsset()

Walks parent links and returns the top-level package record for this asset.

Returns

AssetInventory.Asset

public string GetSafeVersion()

Returns a filesystem-safe version string suitable for cache and extraction paths.

Returns

System.String

public override string ToString()

Returns

System.String

[PrimaryKey]
[AutoIncrement]
public int Id { get; set; }

Returns

System.Int32

[Indexed]
public int ParentId { get; set; }

Returns

System.Int32

[Indexed]
public Asset.Source AssetSource { get; set; }

Returns

AssetInventory.Asset.Source

[Indexed]
[Collation("NOCASE")]
public string Location { get; set; }

Returns

System.String

public string OriginalLocation { get; set; }

Returns

System.String

public string OriginalLocationKey { get; set; }

Returns

System.String

public string Registry { get; set; }

Returns

System.String

public string Repository { get; set; }

Returns

System.String

[Indexed]
public PackageSource PackageSource { get; set; }

Returns

UnityEditor.PackageManager.PackageSource

[Indexed]
public int ForeignId { get; set; }

Returns

System.Int32

public long PackageSize { get; set; }

Returns

System.Int64

[Indexed]
public string SafeName { get; set; }

Returns

System.String

public string DisplayName { get; set; }

Returns

System.String

[Indexed]
public string SafePublisher { get; set; }

Returns

System.String

public string DisplayPublisher { get; set; }

Returns

System.String

[Indexed]
public string SafeCategory { get; set; }

Returns

System.String

public string DisplayCategory { get; set; }

Returns

System.String

public int PublisherId { get; set; }

Returns

System.Int32

public string Slug { get; set; }

Returns

System.String

public int Revision { get; set; }

Returns

System.Int32

public string Description { get; set; }

Returns

System.String

public string KeyFeatures { get; set; }

Returns

System.String

public string CompatibilityInfo { get; set; }

Returns

System.String

public string SupportedUnityVersions { get; set; }

Returns

System.String

[Indexed]
public bool BIRPCompatible { get; set; }

Returns

System.Boolean

[Indexed]
public bool URPCompatible { get; set; }

Returns

System.Boolean

[Indexed]
public bool HDRPCompatible { get; set; }

Returns

System.Boolean

public string Keywords { get; set; }

Returns

System.String

public string PackageDependencies { get; set; }

Returns

System.String

public string Version { get; set; }

Returns

System.String

public string LatestVersion { get; set; }

Returns

System.String

public Asset.Strategy UpdateStrategy { get; set; }

Returns

AssetInventory.Asset.Strategy

public string License { get; set; }

Returns

System.String

public string LicenseLocation { get; set; }

Returns

System.String

public DateTime PurchaseDate { get; set; }

Returns

System.DateTime

public DateTime FirstRelease { get; set; }

Returns

System.DateTime

public DateTime LastRelease { get; set; }

Returns

System.DateTime

public DateTime LastUpdate { get; set; }

Returns

System.DateTime

public float AssetRating { get; set; }

Returns

System.Single

public int RatingCount { get; set; }

Returns

System.Int32

public float Hotness { get; set; }

Returns

System.Single

public float PriceEur { get; set; }

Returns

System.Single

public float PriceUsd { get; set; }

Returns

System.Single

public float PriceCny { get; set; }

Returns

System.Single

public string Requirements { get; set; }

Returns

System.String

public string ReleaseNotes { get; set; }

Returns

System.String

[Indexed]
public Asset.OfficialStateType OfficialState { get; set; }

Returns

AssetInventory.Asset.OfficialStateType

public bool IsHidden { get; set; }

Returns

System.Boolean

[Indexed]
public bool Exclude { get; set; }

Returns

System.Boolean

[Indexed]
public bool NoIndex { get; set; }

Returns

System.Boolean

public bool Backup { get; set; }

Returns

System.Boolean

public bool KeepExtracted { get; set; }

Returns

System.Boolean

public bool UseAI { get; set; }

Returns

System.Boolean

[Indexed]
public bool? UseSemanticIndex { get; set; }

Returns

System.Nullable{System.Boolean}

[Indexed]
public bool? UseCodeIndex { get; set; }

Returns

System.Nullable{System.Boolean}

public int UploadId { get; set; }

Returns

System.Int32

public string ETag { get; set; }

Returns

System.String

public DateTime LastOnlineRefresh { get; set; }

Returns

System.DateTime

public Asset.State CurrentState { get; set; }

Returns

AssetInventory.Asset.State

public Asset.SubState CurrentSubState { get; set; }

Returns

AssetInventory.Asset.SubState

[Ignore]
public Asset ParentAsset { get; set; }

Returns

AssetInventory.Asset

[Ignore]
public bool IsSemanticIndexEnabled { get; }

Returns

System.Boolean

[Ignore]
public bool IsCodeIndexEnabled { get; }

Returns

System.Boolean