PackageUtility

Internal proxy for Unity's UnityEditor.PackageUtility. Provides static access to .unitypackage extraction and asset list preparation.

Definition

Namespace: Paragon.Editor.ThirdPartyPackageImporter.Internals Assembly: Paragon.Editor.dll

[InternalProxy("UnityEditor.PackageUtility", "UnityEditor.CoreModule")]
internal class PackageUtility : InternalProxy<PackageUtility>

Inheritance: InternalProxy<PackageUtility>PackageUtility

Remarks

PackageUtility wraps Unity's internal package extraction API. The ExtractAndPrepareAssetList() method extracts a .unitypackage file and returns an array of raw import items (internal Unity ImportPackageItem objects) along with the package icon path.

The returned raw objects are subsequently wrapped as ImportPackageItem proxies by ThirdPartyPackage.Extract().

Constructors

PackageUtility

public PackageUtility(object packageUtility) : base(packageUtility)
Parameter
Type
Description

packageUtility

object

The internal Unity PackageUtility instance

Methods

ExtractAndPrepareAssetList

Extracts a .unitypackage file and returns its contents as an array of raw import items.

Parameter
Type
Description

packagePath

string

Path to the .unitypackage file

packageIconPath

out string

Receives the path to the package's icon

Returns: Array of raw Unity ImportPackageItem objects. Each should be wrapped via ImportPackageItem.Proxy().

circle-info

Out parameter handling: The internal Unity method uses ref parameters. This proxy passes them as an object array: { packagePath, "", "" } and extracts the icon path from parameters[1] after invocation.

See Also

Last updated