{"record":{"id":"cceddd82176ae8a8","repo":"Unity-Technologies/UnityCsReference","slug":"the-dialogcomplexresult-named-0-has-not-been-imp","errorCode":null,"errorMessage":"The DialogComplexResult named {0} has not been implemented.","messagePattern":"The DialogComplexResult named (.+?) has not been implemented\\.","errorType":"exception","errorClass":"NotImplementedException","httpStatus":null,"severity":"error","filePath":"Editor/Mono/EditorUtility.cs","lineNumber":235,"sourceCode":"        public static int DisplayDialogComplex(string title, string message, string ok, string cancel, string alt)\n        {\n            var result = EditorDialog.DisplayComplexDecisionDialog(\n                titleText: title,\n                messageText: message,\n                defaultButtonText: ok,\n                cancelButtonText: cancel,\n                altButtonText: alt);\n\n            switch (result)\n            {\n                case DialogResult.DefaultAction:\n                    return 0;\n                case DialogResult.AlternateAction:\n                    return 2;\n                case DialogResult.Cancel:\n                    return 1;\n                default:\n                    throw new NotImplementedException(string.Format(\"The DialogComplexResult named {0} has not been implemented.\", result));\n            }\n        }\n\n        public static bool DisplayDialog(string title, string message, string ok, DialogOptOutDecisionType dialogOptOutDecisionType, string dialogOptOutDecisionStorageKey)\n        {\n            EditorDialog.DisplayAlertDialogWithOptOut(\n                titleText: title,\n                messageText: message,\n                buttonText: ok,\n                optOutDecisionType: dialogOptOutDecisionType,\n                optOutKey: dialogOptOutDecisionStorageKey);\n            return true;\n        }\n\n        public static bool DisplayDialog(string title, string message, string ok, string cancel, DialogOptOutDecisionType dialogOptOutDecisionType, string dialogOptOutDecisionStorageKey)\n        {\n            return EditorDialog.DisplayDecisionDialogWithOptOut(\n                titleText: title,","sourceCodeStart":217,"sourceCodeEnd":253,"githubUrl":"https://github.com/Unity-Technologies/UnityCsReference/blob/225b0fbdb57cc17d094e8056b71f8314aba56f73/Editor/Mono/EditorUtility.cs#L217-L253","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\nDialogResult result = (DialogResult)3; // out-of-range cast\n// after\n// only use defined members: Cancel, DefaultAction, AlternateAction","handlingStrategy":"validation","validationCode":"// Only the documented DialogResult values are supported by DisplayDialogComplex's int mapping.\nstatic bool IsKnownResult(EditorDialog.DialogResult r) =>\n    r == EditorDialog.DialogResult.Cancel ||\n    r == EditorDialog.DialogResult.DefaultAction ||\n    r == EditorDialog.DialogResult.AlternateAction;","typeGuard":"static bool IsKnownResult(EditorDialog.DialogResult r) =>\n    Enum.IsDefined(typeof(EditorDialog.DialogResult), r);","tryCatchPattern":null,"preventionTips":["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."],"tags":["dialog","not-implemented","enum","unity-editor"],"backgroundTag":null,"analyzedSha":"225b0fbdb57cc17d094e8056b71f8314aba56f73","analyzedAt":"2026-08-13T19:07:19.849Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}