I’ve got an editor build script which needs to copy a substantial amount of files across a network. I might be missing something but it doesn’t seem that I can use Co-Routines since the editor scripts are not running as MonoBehaviours so I’m resorting to kicking off a worker thread to do the copying.
Now, back in WPF land I’d now use a SynchronizationContext object to invoke GUI updates like a progress bar on the main GUI thread but
SynchronizationContext.Current
always returns null so I assume Unity doesn’t “work like that” under the hood.
My two-part question is therefore;
- Is there a way to execute GUI calls on the Unity main GUI thread from a worker?
- Or does a better/different method to achieve the same result using some aspect of Unity that I don’t know about exist?