Search Unity

Feature Request Compilation pipeline doesn't provide any async method/semaphore/sync method to block running of curr

Discussion in 'Editor & General Support' started by Kwahusss, Jun 16, 2021.

  1. Kwahusss

    Kwahusss

    Joined:
    Sep 21, 2015
    Posts:
    13
    Compilation pipeline doesn't provide any async awaitable method/semaphore/sync method to block current running method while Unity compiling scripts.

    With the new version of Compilation pipepline in the Unity 2021.1, scripts compilation become async. And CompilationPipeline doesn't provide any async method, that can be awaited, nor sync method to recompile scripts in the sync context.

    For example, I want to switch Editor platform and, if the switch was success, run Addressables build. When switching Editor platform, Unity requests script recompilation, but doesn't wait, while compilation will be finished and jumps to the Addressable build line of code, that will fail becaise EdiorApplication.isCompiling == true.