diff --git a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/InspectorDisplayDrawer.cs b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/InspectorDisplayDrawer.cs index 9dd43164..7318cdc0 100644 --- a/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/InspectorDisplayDrawer.cs +++ b/Assets/Plugins/UniRx/Scripts/UnityEngineBridge/InspectorDisplayDrawer.cs @@ -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);