How a request is processed
This page explains the order in which requests at the head of the queue are processed, and how Domain Reloads during processing are handled. Use it to check when hooks and result notifications occur.
Order of steps for one request
Section titled “Order of steps for one request”- The pipeline validates and normalizes the tags. If a tag does not meet the rules, the request ends as failed.
- If
PreImportAnalysisModeisFull, it checks for changes before importing. If nothing has changed, it treats the request as completed without running Unity’s import (see below). - It calls the
OnBeforePackageImporthook. - It runs the import with
AssetDatabase.ImportPackageand records the imported assets. - After the import completes, it calls the
OnPackageImportCompletedhook. - If the request has tags, it adds them as asset labels to the top level of the imported assets.
- It reports the result to the
OnImportRequestFinalizedhook and then to theImportRequestFinalizedevent, and removes the request from the queue.
When the request completes, processing returns to step 1 for the next request. For what happens to the queue on failure or cancellation, see Receive import results.
Pre-import change check
Section titled “Pre-import change check”Each file in the UnityPackage is compared with the file at the same path in the project. If every file meets all of the following conditions, the package is treated as unchanged.
- A file exists at the same path in the project (under
AssetsorPackages) - The SHA-256 hash of the file content matches
- The GUID in the
.metafile matches (if the GUID cannot be read, the SHA-256 hash of the whole.metafile is compared instead)
Even when the package is unchanged, hooks are called and tags are added as usual. If the UnityPackage cannot be read, a warning appears in the Console and the normal import runs.
Adding tags
Section titled “Adding tags”Tags are added to the top level of the imported asset paths (Assets/<folder name>, or a file directly under Assets). Assets outside Assets (such as under Packages) are not labeled. Existing labels are kept, and only missing tags are added.
Domain Reload handling
Section titled “Domain Reload handling”The queue and processing state are saved in Unity’s SessionState. After a Domain Reload, the request that was in progress restarts from the beginning. The saved state is discarded when the editor quits.
In 1.3 and later, Domain Reloads caused by script compilation are deferred while the queue is being processed and run once the queue is empty. The pipeline keeps track of processing even when you import several UnityPackages that contain scripts in a row.
Copyright (c) 2026 天鈴のあ
