Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Resolved How to wait for Domain Reload in code?

Discussion in 'Scripting' started by RaveOnTheGrave, Sep 24, 2023.

  1. RaveOnTheGrave

    RaveOnTheGrave

    Joined:
    Oct 28, 2022
    Posts:
    26
    How can I wait for Domain Reload in Unity editor scripts? Problem is EditorUtility.RequestScriptReload() (causes Domain Reload) is async function but outside of с# domain, in codebase is simple static function what returns void. I found TestRunner's yield instruction WaitForDomainReload, uses this in Editor Coroutine, but this doesn work. I need this for call EditorUtility.RequestScriptReload() before BuildPipeline.BuildPlayer().
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    3,899
  3. RaveOnTheGrave

    RaveOnTheGrave

    Joined:
    Oct 28, 2022
    Posts:
    26
  4. richard_harrington

    richard_harrington

    Unity Technologies

    Joined:
    Sep 29, 2020
    Posts:
    22
    spiney199 likes this.