[IMPROVE] Consistence with Unity indentation
Improvement destription
The indentation of the field does not correspond to Unity expected indentation for nested SerializeReference.
Indentation between the foldout and the label:
The position of the foldout element does not correspond to what is expected either. Note: unity use 15 indent pixel.
The dropdown is more indented then what we expect.
Schema: (AbilityDefinition - ScriptableObject) -- [SerializeReference] (Ability - Plain Old C# Object) ---- [SerializeReference] (Statistic - IStatisticFloat)
Version: 2022.1.8f1, Library Version: 1.3.1
Oh, I'm digging into the problem and realize that Unity has some regression here... Have a fix which solves mentioned but only on version 2020. 2022 & 2024 have weird behavior
Tried to add dirty hack for those versions but stuck into the problem:
Nested foldouts aren't drawn properly even with custom drawer which only useEditorGUI.PropertyField() and nothing else
For example this for comparing versions:
2020 (all is correct)
2022 (look at Property 2/3 arrow and label horizontal positions)
Unity Tech added some bugs into EditorGUI.Foldout control, but I can't understand where, and I don't have an Idea how to fix it - any nested property foldouts drawn incorrect if you use custom drawer.
In the last update, I used the define directive to address the drawing issue between Unity versions, but it didn't completely fix it.
I also tried to migrate to UIElements, but the current UnityEditor API is insufficient here to completely replace the functionality of this package from IMGUI to UIElements. https://github.com/mackysoft/Unity-SerializeReferenceExtensions/issues/51#issuecomment-2266849134
I'll close this issue once as it's not critical.