{"record":{"id":"b744070ef796ed2f","repo":"Unity-Technologies/UnityCsReference","slug":"recursive-enablelivepropertyfeature-are-not-allowe","errorCode":null,"errorMessage":"Recursive EnableLivePropertyFeature are not allowed.","messagePattern":"Recursive EnableLivePropertyFeature are not allowed\\.","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"Editor/Mono/InspectorUtility.cs","lineNumber":109,"sourceCode":"                    continue;\n\n                // Callback\n                var editor = editors[i];\n                if (IsLivePropertyChanged(editor))\n                    editor.isInspectorDirty = true;\n            }\n        }\n\n        // Check if current serialized object contains any live properties.\n        // If so, enable live property feature.\n        [RequiredByNativeCode]\n        internal static bool Internal_HasLiveProperties(IntPtr nativeObjectPtr)\n        {\n            if (!EditorApplication.isPlaying || s_LivePropertyOverrideCallbacks.Count <= 0)\n                return false;\n\n            if (s_CachedSerializedObject.m_NativeObjectPtr != IntPtr.Zero)\n                throw new ArgumentException(\"Recursive EnableLivePropertyFeature are not allowed.\");\n\n            var livePropertyFeatureEnabled = false;\n\n            try\n            {\n                s_CachedSerializedObject.m_NativeObjectPtr = nativeObjectPtr;\n                var target = s_CachedSerializedObject.targetObject;\n                if (target == null)\n                    return false;\n\n                var targetType = target.GetType();\n\n                if (s_LivePropertyOverrideCallbacks.ContainsKey(targetType))\n                {\n                    livePropertyFeatureEnabled = true;\n                }\n            }\n            finally","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/Unity-Technologies/UnityCsReference/blob/225b0fbdb57cc17d094e8056b71f8314aba56f73/Editor/Mono/InspectorUtility.cs#L91-L127","documentation":"Thrown by Internal_HasLiveProperties when the cached serialized object already holds a non-zero native pointer, indicating EnableLivePropertyFeature was called recursively (re-entered) before the previous call completed. The live-property feature is not re-entrant.","triggerScenarios":"A live property override callback triggers another property inspection that re-enters Internal_HasLiveProperties while s_CachedSerializedObject.m_NativeObjectPtr is still set. Native code calling back into the managed live-property path during an in-flight override.","commonSituations":"Custom PropertyDrawer/Inspector that modifies serialized objects from within a live-property override callback, causing recursion. Editor scripts reading SerializedObject properties inside a live update handler.","solutions":["Avoid inspecting/modifying other SerializedObjects from within a live-property override callback.","Defer nested property reads to after the current override callback returns.","If you must read properties, use a non-cached path that does not go through Internal_HasLiveProperties."],"exampleFix":"// before\n// inside a live-property override callback:\nvar other = new SerializedObject(someTarget);\nother.Update(); // re-enters live-property path -> throws\n\n// after\n// defer the work outside the callback:\nEditorApplication.delayCall += () => {\n    var other = new SerializedObject(someTarget);\n    other.Update();\n};","handlingStrategy":"try-catch","validationCode":"// Not directly callable; guard by avoiding nested SerializedObject reads inside override callbacks.","typeGuard":null,"tryCatchPattern":"try { /* property read inside callback */ }\ncatch (ArgumentException ex) when (ex.Message.Contains(\"Recursive\"))\n{ EditorApplication.delayCall += deferredWork; }","preventionTips":["Do not read/modify other SerializedObjects inside live-property callbacks.","Defer nested work via delayCall."],"tags":["unity","editor","live-properties","recursion","serialized-object"],"backgroundTag":null,"analyzedSha":"225b0fbdb57cc17d094e8056b71f8314aba56f73","analyzedAt":"2026-08-13T19:07:19.849Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}