- Home /
How to display a message while editor is blocked?
I have a button in my custom editor that calls a method that blocks the editor for about 10 seconds. The method saves assets to disk using AssetDatabase. The time itself isn't the problem, as the user will expect a 'save' to take a little time, but I can't find any way to get a polite message to show (anywhere) when this happens: "Saving, please wait"
If I try to display a Label field in the Inspector before the method, it does not display, even with a Repaint(). And of course, not even Debug.Log will update in time.
Is there any way to show a message before it becomes blocked?
Thanks
Answer by GameVortex · Dec 17, 2014 at 02:50 PM
What you want is the EditorUtility.DisplayProgressBar. Call it before you start saving assets to disk. And call EditorUtility.ClearProgressBar when you are finished saving the assets. You can also update the progress bar during the saving by calling the DisplayProgressBar again with new values.
Your answer
Follow this Question
Related Questions
Drop down with sizes 1 Answer
ReImport in c# of GameObjects only for Scene Objects, not assets? 1 Answer
Cogwheel icon in inspector 2 Answers