Skip to content

Commit 052230d

Browse files
author
Stewart Miles
committed
Fixed RunOnMainThread.Run() in batch mode.
EditorApplication.update isn't called in batch mode which results in all deferred jobs never executing. This changes RunOnMainThread.Run() to always run a job immediately in batch mode. Change-Id: I9173c412131851aff5053e4f1b70ad816a6d2a17
1 parent a4ccc35 commit 052230d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

source/VersionHandlerImpl/src/RunOnMainThread.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ public static void Run(Action job, bool runNow = true) {
359359
// as part of the process until the queue is empty.
360360
// If we're not executing the job right now, the job queue is pumped from the UnityEditor
361361
// update event.
362-
if ((firstJob || ExecuteNow) && runNow && OnMainThread) {
362+
if (firstJob && (runNow || ExecuteNow) && OnMainThread) {
363363
ExecuteAll();
364364
}
365365
}

0 commit comments

Comments
 (0)