Skip to content

Commit a9763b0

Browse files
committed
Fix foldout layout on Unity 2022.2 or newer
1 parent 2b40c3d commit a9763b0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Editor/SubclassSelectorDrawer.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,13 @@ public override void OnGUI (Rect position, SerializedProperty property, GUIConte
5656
{
5757
Rect foldoutRect = new Rect(position);
5858
foldoutRect.height = EditorGUIUtility.singleLineHeight;
59+
60+
#if UNITY_2022_2_OR_NEWER
61+
// NOTE: Position x must be adjusted.
62+
// FIXME: Is there a more essential solution...?
5963
foldoutRect.x -= 12;
64+
#endif
65+
6066
property.isExpanded = EditorGUI.Foldout(foldoutRect, property.isExpanded, GUIContent.none, true);
6167
}
6268

0 commit comments

Comments
 (0)