Wait x seconds in EditorWindow

I need to wait for a short period of time in an editor script while Unity creates things then resume on the next line of code.

Coroutines don’t work in EditorWindows, so we cannot use the “usual” method. Obviously an endless loop will just block the main thread.

Any suggestions?

https://docs.unity3d.com/Packages/com.unity.editorcoroutines@0.0/api/Unity.EditorCoroutines.Editor.EditorCoroutineUtility.html

Editor coroutines. I’ve used them, but can’t recall what version they first became available. This is 2020.2, but I know I’ve used them in older Unity versions as well.

Thanks, seem to only apply to 2020.1+ but good to know in the future. Also, shame it is not part of the editor and only available as an additional package - but at least can be helpful or individual teams wanting to create editor extensions.

It should have a version for 2019 also, because I know I used it there as well.

https://docs.unity3d.com/Packages/com.unity.editorcoroutines@0.0/manual/index.html

Was usable in 2018+