Skip to content

Commit

Permalink
Fix foldout layout on Unity 2022.2 or newer
Browse files Browse the repository at this point in the history
  • Loading branch information
mackysoft committed Apr 1, 2024
1 parent 2b40c3d commit a9763b0
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,13 @@ public override void OnGUI (Rect position, SerializedProperty property, GUIConte
{
Rect foldoutRect = new Rect(position);
foldoutRect.height = EditorGUIUtility.singleLineHeight;

#if UNITY_2022_2_OR_NEWER
// NOTE: Position x must be adjusted.
// FIXME: Is there a more essential solution...?
foldoutRect.x -= 12;
#endif

property.isExpanded = EditorGUI.Foldout(foldoutRect, property.isExpanded, GUIContent.none, true);
}

Expand Down

0 comments on commit a9763b0

Please sign in to comment.