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

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:

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?

1 Like

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?

1 Like

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.

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?

1 Like

Still broken in 2019

If you believe that it’s a bug, please submit a bug-report, as described in this document:

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.

It still helps users by showing them that it’s an actual limitation (bug or not), and that they have to find an alternative

I have the same issue, I need EditorApplication.update to be called in batchmode.
Does anyone now have a solution?

1 Like