Fix foldout layout on Unity 2022.2 or newer

This commit is contained in:
Makihiro 2024-04-01 16:32:53 +09:00
parent 2b40c3d26e
commit a9763b033d

View File

@ -56,7 +56,13 @@ namespace MackySoft.SerializeReferenceExtensions.Editor
{
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);
}