- Home /
Editor Input Dialog
I'm looking at using an input box dialog so that when the user selects a custom tool bar (MenutItem) option they are presented with a dialog asking them to enter a value. Something akin to the classic VB style InputBox ( http://www.knowdotnet.com/articles/InputBox.jpg ). Preferably this would work exactly the same as the EditorUtility.DisplayDialog() function. The nearest I've got is using a derived EditorWindow and creating my own popup this way, but this is not entirely suitable because focus is not locked to the popup as it would be with DisplayDialog() or a conventional dialog in say Windows/Mac.
Any ideas on how to use either a different part of Unity to achieve this input box or on how to lock focus while the popup is displayed?
Answer by Soviut · Nov 09, 2012 at 07:42 PM
I agree that an input dialog would be very handy.
In the mean time, you may be interested in some of the solutions for doing modal dialogues here:
http://answers.unity3d.com/questions/139677/how-to-make-a-modal-dialog.html
It would be nice if you posted your code for the custom editor window as a new answer, just so there's a complete solution available for others when they come across this.
Answer by tangentstorm · Mar 07, 2015 at 05:46 PM
There is now an example of doing something like this in the docs.
http://docs.unity3d.com/ScriptReference/EditorWindow.ShowPopup.html