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. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

EditorApplication.update callback is not called while run build from command line

Discussion in 'Editor & General Support' started by Darkwing_Duck, Jan 12, 2018.

  1. Darkwing_Duck

    Darkwing_Duck

    Joined:
    Sep 29, 2016
    Posts:
    11
    Hi, I have a trouble with unity editor update callback.
    I start a build from command line with specific -executeMetod.

    In C# code I do like this:
    Code (CSharp):
    1. EditorApplication.update += MyUpdate;
    But the method MyUpdate will newer be called.

    I use Unity 2017.3.0p1 and osX High Sierra
    But when I used Unity 2017.2.1p1 it worked.

    In what can be the problem?
     
    Last edited: Jan 13, 2018
    mghts likes this.
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,419
    Isn't using -executeMethod simply instructing Unity to execute said method and then quit? If that method is blocking, such as not giving control back to the editor during its execution, the editor callbacks never have a chance to run.

    What are you trying to do that you need the update callback?
     
  3. Darkwing_Duck

    Darkwing_Duck

    Joined:
    Sep 29, 2016
    Posts:
    11
    In the -executeMethod I do:
    1. Load config from server and apply it. To load config I use UnityWebRequest (it also doesn't work - request will never be completed).
    2. Build Player
    3. Exit

    After config will be loaded Build Player should be started next. And because UnityWebRequest doesn't completed the Build Player phase will never be started. And my build process hangs.

    i am sure that main thread is not locked at the moment

    when I use Unity 2017.2.1p1 all works as expected. BUT, my friend tried to run build on the same version of Unity and he is got the same problem with update callback.

    I thing that the issue with UnityWebRequest related to editor update callback

    Maybe it depends on osx version?
    I use High Sierra and he use Sierra.
     
    Last edited: Jan 14, 2018
  4. Gizmoi

    Gizmoi

    Joined:
    Jan 9, 2013
    Posts:
    327
    I am trying to do a similar thing. I'm attempting to wait for Unity to bake lightmaps and attaching to the update delegate to do so.
    My delegate is never called when running with -executeMethod however.

    Did you ever find a way around this?
     
    mghts likes this.
  5. mghts

    mghts

    Joined:
    Jan 24, 2019
    Posts:
    2
    Still broken in 2019
     
  6. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,419
    If you believe that it's a bug, please submit a bug-report, as described in this document:
    https://unity3d.com/unity/qa/bug-reporting

    Posting "still broken" isn't going to make Unity Technologies come up with a fix. Submitting a bug-report on the other hand allows them to take a look at the issue.

    After you submitted the bug-report, you receive a confirmation email with a bug-report Case number. You can post this Case number (the number only, not the link) in this forum thread for Unity staff to pick up, in case they see it.
     
  7. mghts

    mghts

    Joined:
    Jan 24, 2019
    Posts:
    2
    It still helps users by showing them that it's an actual limitation (bug or not), and that they have to find an alternative
     
  8. JOKER_LD

    JOKER_LD

    Joined:
    Feb 7, 2018
    Posts:
    6
    I have the same issue, I need EditorApplication.update to be called in batchmode.
    Does anyone now have a solution?
     
    Petr777 likes this.