[ Web Proxy ]
URL:
Viewing: https://docs.unity3d.com/ScriptReference/AssetDatabase.IsAssetImportWorkerProcess.html [Back]  [Original]

Unity - Scripting API: AssetDatabase.IsAssetImportWorkerProcess
Version: Unity 6.5 (6000.5)
    • Supported
    • Legacy
    LanguageEnglish
    • C#

    AssetDatabase.IsAssetImportWorkerProcess

    Suggest a change

    Success!

    Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

    Close

    Submission failed

    For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

    Close
    Your name Your email Suggestion* Submit suggestion

    Cancel

    Declaration

    public static bool IsAssetImportWorkerProcess();

    Returns

    bool true if running in an asset import worker process; false if running in the main Editor process.

    Description

    Determines whether the current process is an Asset Import Worker process.

    This method allows import code to detect whether it's running in the main Unity Editor process or in a separate asset import worker process. Asset import workers are long-running processes that communicate with the main Editor to import assets in parallel. Each worker maintains its own global state that persists between import jobs, and global state changes made in worker processes are not reflected in the main Editor process.

    Global state modifications during asset import can cause import results to vary between workers and over time, breaking deterministic asset processing and leading to unpredictable behavior. The best practice is to design import code to be stateless and self-contained using local variables, method parameters, or return values rather than static fields, global variables, or singleton patterns.

    Use this method only when you need to conditionally skip global state modifications that cannot be immediately refactored. For example, you might use it to avoid registering objects with singletons or writing to global caches when running in a worker process.


    Web Proxy Viewer  |  New URL  |  Original Page