Unity-Technologies/UnityCsReference · error · NotImplementedException
The DialogComplexResult named {0} has not been implemented.
Error message
The DialogComplexResult named {0} has not been implemented. What it means
Thrown by the default arm of a switch over EditorDialog.DialogResult when converting a complex dialog result to an int button index. The DialogResult enum currently defines Cancel(-1), DefaultAction(0), AlternateAction(1) and all three are handled, so this NotImplementedException is a forward-compatibility guard: it fires only if a new enum member is added to DialogResult without updating DisplayDialogComplex's mapping, or if a caller casts an arbitrary integer into DialogResult.
Source
Thrown at Editor/Mono/EditorUtility.cs:235
public static int DisplayDialogComplex(string title, string message, string ok, string cancel, string alt)
{
var result = EditorDialog.DisplayComplexDecisionDialog(
titleText: title,
messageText: message,
defaultButtonText: ok,
cancelButtonText: cancel,
altButtonText: alt);
switch (result)
{
case DialogResult.DefaultAction:
return 0;
case DialogResult.AlternateAction:
return 2;
case DialogResult.Cancel:
return 1;
default:
throw new NotImplementedException(string.Format("The DialogComplexResult named {0} has not been implemented.", result));
}
}
public static bool DisplayDialog(string title, string message, string ok, DialogOptOutDecisionType dialogOptOutDecisionType, string dialogOptOutDecisionStorageKey)
{
EditorDialog.DisplayAlertDialogWithOptOut(
titleText: title,
messageText: message,
buttonText: ok,
optOutDecisionType: dialogOptOutDecisionType,
optOutKey: dialogOptOutDecisionStorageKey);
return true;
}
public static bool DisplayDialog(string title, string message, string ok, string cancel, DialogOptOutDecisionType dialogOptOutDecisionType, string dialogOptOutDecisionStorageKey)
{
return EditorDialog.DisplayDecisionDialogWithOptOut(
titleText: title,View on GitHub (pinned to 225b0fbdb5)
Solutions
- If you forked/patched EditorUtility.cs, add a case for the new DialogResult member and return a sensible index.
- If hitting it after a Unity upgrade, ensure the editor assemblies and EditorDialog.cs are from the same version (mismatched DLLs in the project).
- If you are casting raw ints to DialogResult, stop — use the documented enum values only.
Example fix
// before DialogResult result = (DialogResult)3; // out-of-range cast // after // only use defined members: Cancel, DefaultAction, AlternateAction
Defensive patterns
Strategy: validation
Validate before calling
// Only the documented DialogResult values are supported by DisplayDialogComplex's int mapping.
static bool IsKnownResult(EditorDialog.DialogResult r) =>
r == EditorDialog.DialogResult.Cancel ||
r == EditorDialog.DialogResult.DefaultAction ||
r == EditorDialog.DialogResult.AlternateAction; Type guard
static bool IsKnownResult(EditorDialog.DialogResult r) =>
Enum.IsDefined(typeof(EditorDialog.DialogResult), r); Prevention
- Never cast arbitrary ints to DialogResult; use the named members.
- After a Unity upgrade, rebuild all editor assemblies together so EditorDialog and EditorUtility stay in sync.
- If you patch EditorUtility.cs, add a case whenever you add a DialogResult member.
When it happens
Trigger: A future Unity version adds a new DialogResult value (e.g. a third action button) but EditorUtility.DisplayDialogComplex is not updated to return a corresponding int index. A user casts a raw int outside {-1,0,1} to DialogResult and passes it through this switch.
Common situations: Hitting this in practice means an internal Unity version mismatch — a newer editor assembly returned a DialogResult the older/patched EditorUtility.cs does not know about. Almost never seen from user scripts because the dialog UI only ever produces the three handled values.
Related errors
- The DialogOptOut type named {0} has not been implemented.
- Unknown opt out decision type
- Unknown dialog icon type
- Parameter selected must be of type System.Enum
- Parameter enumValue must be of type System.Enum
AI-assisted analysis of Unity-Technologies/UnityCsReference@225b0fbdb5 (2026-08-13).
Data as JSON: /api/errors/cceddd82176ae8a8.
Report an issue: GitHub.