1.11.2: Fixed issue, where ReadableScriptableObject would block input to later drawn fields, due to Repaint having reverse drawing order (fixed for 6.3.0 or newer)

This commit is contained in:
Anders Ejlersen 2025-12-28 21:28:04 +01:00
parent f4c4a58283
commit 6e3bd4df70
2 changed files with 13 additions and 9 deletions

View file

@ -16,7 +16,6 @@ namespace Module.Inspector.Editor
EditorGUI.BeginChangeCheck();
EditorGUI.BeginProperty(position, label, property);
{
if (property.objectReferenceValue != null)
{
@ -44,7 +43,6 @@ namespace Module.Inspector.Editor
property.objectReferenceValue = EditorGUI.ObjectField(rectObj, property.objectReferenceValue, property.GetValueType(), false);
}
}
EditorGUI.EndProperty();
bool hasChanged = EditorGUI.EndChangeCheck();
@ -78,6 +76,11 @@ namespace Module.Inspector.Editor
GUIStyle style = property.objectReferenceValue != null ? EditorStyles.foldoutHeader : EditorStyles.label;
bool foldout = property.isExpanded;
#if UNITY_6000_3_OR_NEWER
position.width = rectObj.x - position.x;
foldout = GUI.Toggle(position, foldout, label, style);
property.objectReferenceValue = EditorGUI.ObjectField(rectObj, property.objectReferenceValue, property.GetValueType(), false);
#else
if (Event.current.type == EventType.Repaint)
{
GUI.Toggle(position, foldout, label, style);
@ -88,6 +91,7 @@ namespace Module.Inspector.Editor
property.objectReferenceValue = EditorGUI.ObjectField(rectObj, property.objectReferenceValue, property.GetValueType(), false);
foldout = GUI.Toggle(position, foldout, label, style);
}
#endif
return foldout;
}

View file

@ -1,6 +1,6 @@
{
"name": "com.module.inspector",
"version": "1.11.1",
"version": "1.11.2",
"displayName": "Module.Inspector",
"description": "Custom inspector with various useful property drawers",
"unity": "2019.2",