I would like to call Lightmapping.BakeAsync, wait it to finish (without freeze the editor) and do something else when it’s done. As long I can’t call Unity API from any thread but the main one, how could I achieve that?
[MenuItem("Bake/Bake")]
public static void Bake() {
// Do something
Lightmapping.BakeAsync();
// Wait till it's done.
// Another Unity API call
}