Disable the scene while displaying editor progress bar.
hi, I am displaying a progress bar using "EditorUtility.DisplayProgressBar", but I still can modify the scene while progress bar is showing. I don't want scene to be modified while editor script is processing the scene. Is it possible to display the progress bar and disable scene editing.
Answer by YinXiaozhou · Sep 19, 2016 at 03:20 AM
Can you give more detail about the work you want to process by the script? Since if you do the processing in one single call. The editor will be blocked automatically. Like,
public class testEditor
{
[MenuItem("Test/TestProgressBar")]
static void TestProgressBar()
{
double startTime = EditorApplication.timeSinceStartup;
while(EditorApplication.timeSinceStartup < startTime + 5)
EditorUtility.DisplayProgressBar("", "", (float)((EditorApplication.timeSinceStartup - startTime) / 5));
EditorUtility.ClearProgressBar();
}
}
Hi,
I am using co-routine in the editor, so that I can print out debug logs to see what is happening.
@paragb Then I guess you need to choose one, blocking input or watching the log output. BTW you can also show the progress information in the progress bar.
hi, Thank you, i guess i'll have to use progress information in progress bar.