x


Custom dialog in editor

How can I show a custom dialog in the editor?

I have a dialog I want to make, that contains some checkboxes and some other random controls. I want to show it to the user when they click on a button (in a custom inspector I have already made) in order to choose what to do.

How would I go about doing this in Unity? I can only find dialog calls that are simple message boxes...

more ▼

asked Oct 18 '11 at 08:08 PM

AntonStruyk gravatar image

AntonStruyk
76 9 11 14

(comments are locked)
10|3000 characters needed characters left

2 answers: sort newest

Are you looking for ScriptableWizards?

They're like popup windows that you can add controls to.

They allow you to set a bunch of values (even drag and drop game objects) and then execute code when different buttons are pressed.

more ▼

answered Oct 19 '11 at 12:58 AM

jahroy gravatar image

jahroy
3.2k 14 18 41

I think I can do what I need with a one-pane wizard. Thanks!

Oct 20 '11 at 02:15 PM AntonStruyk
(comments are locked)
10|3000 characters needed characters left

Unfortunately (AFAIK) there's no way to display an editor window as a modal window. The only thing that comes with Unity are the simple dialg boxes you've already found (EditorUtility.DisplayDialogComplex).

Well, in a multitasking environment modal windows are evil, Just in some rare cases they would be helpful. Just check if you really need it modal. The user would be pleased when he still can select other things to look up some settings or whatever...

A more or less related question:
http://answers.unity3d.com/questions/139677/how-to-make-a-modal-dialog.html

more ▼

answered Oct 18 '11 at 11:50 PM

Bunny83 gravatar image

Bunny83
45.2k 11 49 207

AssetModificationProcess.OnWillSaveAssets is a good example of a time when you might need a modal dialog. I want to present the user with various options for what to do (overwrite, skip, skip remaining, get SVN lock, etc.) and it needs to be modal because the method has to return an array of strings immediately.

Nov 17 '12 at 01:04 AM yoyo
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1670
x32

asked: Oct 18 '11 at 08:08 PM

Seen: 2374 times

Last Updated: Nov 17 '12 at 01:04 AM