static void DisplayDialog( string title, string message, string okay, string icon, Widget parent )
static void DisplayDialog( string title, string message, string noLabel, string yesLabel, System.Action action, string icon, Widget parent )

robot_2Generated
code_blocksInput

Description

The DisplayDialog method in the Editor.EditorUtility class is used to display a simple dialog box with a title, message, and an OK button. This method is useful for providing information or alerts to the user within the editor environment.

Usage

To use the DisplayDialog method, you need to provide the following parameters:

  • title (string): The title of the dialog box.
  • message (string): The message to be displayed in the dialog box.
  • okay (string): The label for the OK button.
  • icon (string): The icon to be displayed in the dialog box. This can be a path to an icon file or a predefined icon name.
  • parent (Editor.Widget): The parent widget for the dialog. This determines the dialog's position and modality relative to the parent.

Example

// Example usage of DisplayDialog
Editor.EditorUtility.DisplayDialog(
    "Warning",
    "This action cannot be undone.",
    "OK",
    "warning_icon",
    parentWidget
);