Version: Unity 6.7 Beta (6000.7)
LanguageEnglish
  • C#

EditorDialogEvents

class in UnityEditor

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

Raises events when a modal dialog opens or closes anywhere in the Editor.

Use these events to detect that a dialog is blocking the Editor's main thread rather than that the Editor has stopped responding.

Coverage is mechanism-based, not exhaustive — only dialogs shown through the two paths below are visible here. Confirmed covered: the EditorUtility.DisplayDialog family and other native alerts (via DialogScope), and any EditorWindow shown with EditorWindow.ShowModal or EditorWindow.ShowModalUtility (both route through MakeModal, on every platform). Confirmed NOT covered: OS-native file and folder pickers (EditorUtility.OpenFilePanel, EditorUtility.SaveFilePanel, and their siblings) — they bind directly to the platform's own picker APIs, with no DialogScope or MakeModal involved. Any other dialog implemented through a different mechanism (a custom native window, or Editor UI that isn't an EditorWindow) is also not covered. Treat the absence of a dialogWillShow/dialogDismissed pair as "no dialog of a covered kind is open," not as proof the Editor isn't blocked by some other popup — callers still need a fallback signal (for example, a command timeout) for the uncovered cases.

Events

Event Description
dialogDismissedRaised when a dialog that previously raised dialogWillShow is dismissed.
dialogWillShowRaised before a dialog is shown to the user.