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

Fix bug with reactive property serialization with Odin Inspector #531

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 @@ -122,7 +122,11 @@ public override void OnGUI(Rect position, UnityEditor.SerializedProperty propert

var paths = property.propertyPath.Split('.'); // X.Y.Z...
var attachedComponent = property.serializedObject.targetObject;


#if ODIN_INSPECTOR
var fieldInfo = attachedComponent.GetType().GetField(this.fieldInfo.Name, BindingFlags.IgnoreCase | BindingFlags.GetProperty | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
#endif

var targetProp = (paths.Length == 1)
? fieldInfo.GetValue(attachedComponent)
: GetValueRecursive(attachedComponent, 0, paths);
Expand Down