ImportPackageItem

Internal proxy for Unity's UnityEditor.ImportPackageItem. Represents a single file or folder within a .unitypackage, with metadata about paths, import status, conflicts, and enabled state. This is the central data type processed by all import/export processors.

Definition

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

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

Inheritance: InternalProxy<ImportPackageItem>ImportPackageItem

Remarks

ImportPackageItem instances are created by wrapping the raw objects returned from PackageUtility.ExtractAndPrepareAssetList(). Each proxy exposes Unity's internal fields via reflection, allowing processors to read and modify import behavior (destination paths, enabled status, conflict flags) before the actual import occurs.

The Visible property is a local-only property (not proxied to Unity internals) used by the PrepareProcessor to filter which items are shown in the import UI.

Quick Lookup

Goal
How

Get destination path

item.destinationAssetPath

Check if item exists in project

item.exists

Check for path conflicts

item.pathConflict

Enable/disable for import

item.enabledStatus = 1 (enabled) or 0 (disabled)

Check if item is a folder

item.isFolder

Check if asset changed

item.assetChanged

Get GUID

item.guid

Properties

Visible

Local property (not proxied). Controls whether this item is shown in the import UI. Set by PrepareProcessor.

existingAssetPath

Path to the existing asset in the project (if any). Set by PathProcessor during path remapping.

exportedAssetPath

Original path of the asset as stored in the .unitypackage.

destinationAssetPath

Final destination path where the asset will be imported. Modified by PathProcessor for path remapping.

sourceFolder

Source folder within the package.

previewPath

Path to the asset's preview image.

guid

Asset GUID. Used for GUID-based conflict detection.

enabledStatus

Import enabled state: 1 = enabled, 0 = disabled. Controls whether this item is included in the import.

isFolder

Whether this item represents a folder rather than a file.

exists

Whether the asset already exists in the project at the destination path.

assetChanged

Whether the asset content differs from the existing version.

pathConflict

Whether the destination path conflicts with an existing asset at a different GUID.

projectAsset

Whether this is a project-level asset (e.g., ProjectSettings).

Constructors

ImportPackageItem

Parameter
Type
Description

importPackageItem

object

The internal Unity ImportPackageItem instance

Methods

ToString

Returns: The destinationAssetPath.

See Also

  • PackageUtility — Extracts the raw items that are wrapped by this proxy

  • PackageImport — Manages the import dialog containing these items

  • ThirdPartyPackage — Wraps arrays of these items for processor iteration

  • PathProcessor — Modifies destinationAssetPath, existingAssetPath, and conflict flags

  • PrepareProcessor — Sets Visible to control UI display

Last updated