Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

Fixed ArgumentException: Field unlocked defined #452

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,12 @@ public override void OnGUI(Rect position, UnityEditor.SerializedProperty propert
var paths = property.propertyPath.Split('.'); // X.Y.Z...
var attachedComponent = property.serializedObject.targetObject;

var targetProp = (paths.Length == 1)
? fieldInfo.GetValue(attachedComponent)
var targetProp = (paths.Length == 1) ?
#if ODIN_INSPECTOR
attachedComponent.GetType().GetField(fieldInfo.Name).GetValue(attachedComponent)
#else
fieldInfo.GetValue(attachedComponent)
#endif
: GetValueRecursive(attachedComponent, 0, paths);
if (targetProp == null) return;
var propInfo = targetProp.GetType().GetProperty(fieldName, BindingFlags.IgnoreCase | BindingFlags.GetProperty | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
Expand Down