Import UnityPackages from a queue
Queue UnityPackage import requests from your own editor extension and import them in order. All types are in the com.amari_noa.unitypackage_pipeline_core.editor namespace.
Import
Section titled “Import”-
Get the pipeline from
AmariUnityPackageImportPipeline.Service. A single pipeline is created when the editor starts (and on every Domain Reload), and all callers share it.using com.amari_noa.unitypackage_pipeline_core.editor;var service = AmariUnityPackageImportPipeline.Service; -
Subscribe to the
ImportRequestFinalizedevent to receive results. For what you receive, see Receive import results.service.ImportRequestFinalized += result =>{// Use result.ImportStatus, result.ImportedAssets, and so on}; -
Create an
AmariUnityPackageImportRequestand add it to the queue withEnqueue. The second argument (tags) is optional. To add several requests at once, useEnqueueMultiple.service.Enqueue(new AmariUnityPackageImportRequest("C:/Downloads/Example.unitypackage",new[] { "example-tag" })); -
Call
StartImportto start importing from the head of the queue. When a request completes, the pipeline moves on to the next one automatically.service.StartImport();
Add tags
Section titled “Add tags”Tags in a request are added as Unity asset labels to the top level of the imported assets (such as Assets/<folder name>). Existing labels are kept.
- Leading and trailing spaces are removed, and duplicate tags are merged.
- Tags can contain letters, digits,
_,-,., and/, and can be up to 128 characters long. If a tag does not meet these rules, the request fails.
Change the behavior
Section titled “Change the behavior”| Property | Description |
|---|---|
InteractiveMode |
When true, shows Unity’s standard Import Unity Package window so the user can confirm. When false, imports without confirmation. The default is true |
PreImportAnalysisMode |
Whether to check for changes before importing. Full (the default) skips the import when nothing has changed. Skip always imports |
QuietMode |
While true, defers QueueChanged notifications while requests remain in the queue, then raises one notification when set back to false. Also suppresses some of this package’s info and warning logs |
Stop or clear the queue
Section titled “Stop or clear the queue”ClearQueueremoves the pending requests. The request in progress stays and continues.ResetPipelineAndClearQueueends the request in progress as cancelled (with the reasonPipelineReset) and empties the queue.
Service members
Section titled “Service members”The members of IAmariUnityPackageImportPipelineService are as follows.
| Member | Description |
|---|---|
Enqueue / EnqueueMultiple |
Adds import requests to the queue |
StartImport |
Starts importing from the head of the queue. Does nothing if a request is already in progress |
ClearQueue |
Removes pending requests (the request in progress stays) |
ResetPipelineAndClearQueue |
Ends the request in progress as cancelled and empties the queue |
IsImporting |
Whether a request is in progress |
RemainingCount |
The number of requests left in the queue (including the one in progress) |
CurrentTags |
The normalized tags of the request in progress |
GetQueueSnapshot |
Gets a copy of the queue |
InteractiveMode / PreImportAnalysisMode / QuietMode |
Behavior settings (see above) |
ImportRequestFinalized |
Raised when a request ends as completed, failed, or cancelled |
QueueChanged |
Raised when the queue or the processing state changes |
RegisterHook / UnregisterHook |
Registers or unregisters a hook |
Copyright (c) 2026 天鈴のあ
