Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IMPROVE] Consistence with Unity indentation #57

Open
Simferoce opened this issue Apr 8, 2024 · 1 comment
Open

[IMPROVE] Consistence with Unity indentation #57

Simferoce opened this issue Apr 8, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@Simferoce
Copy link

Improvement destription

The indentation of the field does not correspond to Unity expected indentation for nested SerializeReference.

Indentation between the foldout and the label:
image
image

The position of the foldout element does not correspond to what is expected either. Note: unity use 15 indent pixel.
image

image

The dropdown is more indented then what we expect.
image
image

Schema:
(AbilityDefinition - ScriptableObject)
-- [SerializeReference] (Ability - Plain Old C# Object)
---- [SerializeReference] (Statistic - IStatisticFloat)

Version: 2022.1.8f1, Library Version: 1.3.1

@Simferoce Simferoce added the enhancement New feature or request label Apr 8, 2024
@Maligan
Copy link

Maligan commented Apr 26, 2024

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)
2020 - correct

2022 (look at Property 2/3 arrow and label horizontal positions)
2022 - incorrect

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants