# DisplayDecisionDialog(string, string, string, string, DialogIconType)

> Displays a decision dialog box with a title, icon, message, and two buttons.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor](/engine/6000.5/script-reference/unityeditor.md)
* **Assembly:** UnityEditor.CoreModule

```csharp
public static bool DisplayDecisionDialog(string titleText, string messageText, string yesButtonText, string noButtonText, DialogIconType iconType = DialogIconType.Warning)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The title of the dialog box. If left null, defaults to "Unity".**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The message to display in the dialog box.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The text to display on the Yes button. If left null, it defaults to "Yes".**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): The text to display on the No button. If left null, it defaults to "No".**** (\[DialogIconType]\(/engine/6000.5/script-reference/unityeditor/dialogicontype)): The icon to display in the dialog box. Defaults to [DialogIconType.Warning](/engine/6000.5/script-reference/unityeditor/dialogicontype/warning.md).

### Returns

| Type                                                          | Description                                                                                   |
| ------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | Returns `true` if the user clicked the Yes button, `false` if the user clicked the No button. |

### Remarks

If `messageText` is null or whitespace, an `ArgumentNullException` is thrown. If `messageText` is longer than 512 characters, it is truncated and the full message is logged to the console in markdown format.

If any button's text is longer than 64 characters, an `ArgumentException` is thrown.

The default button is the Yes button. If the user presses the enter key (return key on macOS), the Yes button is clicked. The other button is the No button. If the user presses the escape key or closes the dialog, the No button is clicked. On macOS, the orientation of the buttons might be horizontal or vertical depending on the length of the message.

The following example demonstrates how to display a decision dialog box with a warning icon, a title, a message, and Yes and No buttons.

```csharp
using UnityEditor;
using UnityEngine;

namespace Examples
{
    public class DisplayDecisionDialogExamples : MonoBehaviour
    {
        [MenuItem("Window/EditorDialog Example/DisplayDecisionDialog with all parameters specified")]
        public static void DisplayDecisionDialogExample()
        {
            bool userResponse = EditorDialog.DisplayDecisionDialog(
                "Unity - Custom Title",
                "This is a test of the EditorDialog API. Do you wish to continue?",
                "Affirmative",
                "Negative",
                DialogIconType.Info);

            Debug.Log(userResponse);
        }

        [MenuItem("Window/EditorDialog Example/DisplayDecisionDialog with defaults")]
        public static void DisplayDecisionDialogSimpleExample()
        {
            bool userResponse = EditorDialog.DisplayDecisionDialog(null, "This is a test of the EditorDialog API with defaults. Please select an option below.", null, null);
            Debug.Log(userResponse);
        }
    }
}
```

Produces the following dialog boxes on macOS:

![DisplayDecisionDialogExample (DisplayDecisionDialog(string, string, string, string, DialogIconType))](/api/media?file=/engine/6000.5/media/images/DisplayDecisionDialogExample.png)

![DisplayDecisionDialogSimpleExample (DisplayDecisionDialog(string, string, string, string, DialogIconType))](/api/media?file=/engine/6000.5/media/images/DisplayDecisionDialogSimpleExample.png).
