Unity Assets‎ > ‎Common Dialogs‎ > ‎

Quick Start

Basic Quick Start:

1. Go to the "Tools/Common Dialogs/Create Dialog Manager" menu and add a new Dialog Manager.
    Alternatively you can drag and drop "CommonDialogs/Prefabs/DialogManager" to your scene.
2. In your code, use the DialogManager static functions to create your dialogs.

Basic Quick Usage:

To create a new dialogs, use the DialogManager.createXDialog methods.

For example:

FileDialog myFileDialog = DialogManager.createFileDialog();
myFileDialog.show(FileDialogMode.Save, "My Save Dialog", "*.txt", s => myCallbackFunction);

You can also use the quick static methods:

DialogManager.getSaveFiile("My Save Dialog", "*.txt", s => myCallbackFunction);

List of quick static methods:

* To get a file name to save a file from the user use : DialogManager.getSaveFile
* To get a file name to load from the user use : DialogManager.getLoadFile
* To get a path to a directory from the user use : DialogManager.selectPath
* To show an error message : DialogManager.error
* To show a warning message : DialogManager.warning
* To show an info message : DialogManager.info
* To show a yes/no confirmation dialog : DialogManager.confirm
* To show a temporary notification message box : DialogManager.notify
* To get a float value from the user : DialogManager.getFloat
* To get an integer value from the user : DialogManager.getInt
* To get a multiple choice answer from the user : DialogManager.getChoice
* To show a login dialog use : DialogManager.getLogin

Alternatively you can drag and drop the various dialog prefabs to the DialogManager instance in your scene as a child object.  Remember to the click the "DestroyOnClose" flag if you want to reuse the dialog.  Make a reference in one of your other objects to the newly created dialog object.  Call the various "show" or "hide" commands on the dialogs to control when to pop or close the dialog.  Take a look at the DialogManager code for some more ideas on how to use the dialogs.

Most dialogs are fairly easy to customize for your UI.  Directly editing the prefab instances is the easiest way.  You can drag an drop a dialog prefab on to the DialogManager and then set the main dialog's panel to enabled to see it.  From there you can you customize the look by changing the various sprites.  Remember to Apply your changes to the prefabs when done.  You may need to drag and drop additional prefabs for customization such as editing Menus, MenuItems, ToolBarButtons, etc.

See the How-To documentation for additional details.