{"record":{"id":"a198b34935f7c767","repo":"Unity-Technologies/UnityCsReference","slug":"don-t-know-how-to-display-value","errorCode":null,"errorMessage":"Don't know how to display value.","messagePattern":"Don't know how to display value\\.","errorType":"exception","errorClass":"NotImplementedException","httpStatus":null,"severity":"error","filePath":"Editor/Mono/Modules/DefaultPluginImporterExtension.cs","lineNumber":87,"sourceCode":"\n            internal virtual void Apply(PluginImporterInspector inspector)\n            {\n                string valueString = type == typeof(bool) ? value.ToString().ToLower() : value.ToString();\n                inspector.importer.SetPlatformData(platformName, key, valueString);\n            }\n\n            internal virtual void OnGUI(PluginImporterInspector inspector)\n            {\n                if (type == typeof(bool)) value = EditorGUILayout.Toggle(name, (bool)value);\n                else if (type.IsEnum)\n                {\n                    if (type.IsDefined(typeof(FlagsAttribute), false))\n                        value = EditorGUILayout.EnumFlagsField(name, (Enum)value);\n                    else\n                        value = EditorGUILayout.EnumPopup(name, (Enum)value);\n                }\n                else if (type == typeof(string)) value = EditorGUILayout.TextField(name, (string)value);\n                else throw new NotImplementedException(\"Don't know how to display value.\");\n            }\n        }\n\n        internal bool propertiesRefreshed = false;\n\n        public DefaultPluginImporterExtension(Property[] properties)\n        {\n            this.properties = properties;\n        }\n\n        protected virtual Property[] GetPropertiesForInspector(PluginImporterInspector inspector)\n        {\n            return properties;\n        }\n\n        public virtual void ResetValues(PluginImporterInspector inspector)\n        {\n            hasModified = false;","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/Unity-Technologies/UnityCsReference/blob/225b0fbdb57cc17d094e8056b71f8314aba56f73/Editor/Mono/Modules/DefaultPluginImporterExtension.cs#L69-L105","documentation":"Thrown when DefaultPluginImporterExtension.OnGUI encounters a property whose Type is not one of the handled primitives (bool, enum, string). The inspector only knows how to render a closed set of types via EditorGUILayout; anything else raises NotImplementedException.","triggerScenarios":"A native plugin declares a Property whose Type is, e.g., int, float, Vector3, double, or any custom/struct type, and the plugin importer inspector tries to render it. OnGUI dispatches through if/else chains and hits the final else.","commonSituations":"Third-party or custom platform plugin returns properties with numeric or struct types that the default inspector GUI does not support. Plugin SDK version change introduces a new property type.","solutions":["Subclass DefaultPluginImporterExtension and override OnGUI to add handling for the custom type before calling base.OnGUI.","Change the Property type to a supported primitive (bool, enum, or string) in the plugin's metadata.","If the property is not user-editable, remove it from GetPropertiesForInspector so it is never rendered."],"exampleFix":"// before\nelse if (type == typeof(string)) value = EditorGUILayout.TextField(name, (string)value);\nelse throw new NotImplementedException(\"Don't know how to display value.\");\n// after: extend the dispatch\nelse if (type == typeof(float)) value = EditorGUILayout.FloatField(name, (float)value);\nelse if (type == typeof(int)) value = EditorGUILayout.IntField(name, (int)value);\nelse throw new NotImplementedException($\"Don't know how to display value of type {type}.\");","handlingStrategy":"validation","validationCode":"static readonly HashSet<Type> k_Supported = new(){ typeof(bool), typeof(string) };\nbool CanDisplay(Type t) => k_Supported.Contains(t) || t.IsEnum;","typeGuard":"static bool IsInspectableProperty(Type type) =>\n    type == typeof(bool) || type.IsEnum || type == typeof(string);","tryCatchPattern":"try { inspector.OnGUI(); }\ncatch (NotImplementedException) { /* hide the unsupported property row */ }","preventionTips":["Restrict plugin Property types to bool/enum/string.","Override OnGUI to extend the dispatch table for custom types."],"tags":["unity","plugin-importer","imgui","inspector","not-implemented"],"backgroundTag":null,"analyzedSha":"225b0fbdb57cc17d094e8056b71f8314aba56f73","analyzedAt":"2026-08-13T19:07:19.849Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}