TylerTemp / SaintsField

A Unity Inspector extension tool focusing on script fields inspector enhancement
MIT License
148 stars 9 forks source link

How to insert `[Space]` right before `[LayoutGroup]` starts? #52

Closed KamilTheDev closed 1 month ago

KamilTheDev commented 1 month ago

If I have the following code:

public Image maskImage;
[ReadOnly] public float initialScale;

[Space(100f)]

[LayoutGroup("Animation", ELayout.Background | ELayout.TitleOut)]
public float duration = 1f;
public Ease easeIn;
public Ease easeOut;
[LayoutEnd("Animation")]

I get the result: Screenshot 2024-07-14 230107

How can I make the space appear outside of the [LayoutGroup]?

TylerTemp commented 1 month ago

At this point, no.

I am plaining to add some space for Layout to increase some readability, and also #44 will also allow to set space below a field, so please stay tuned.

TylerTemp commented 1 month ago

Hi,

Though not directly related, the 3.1.5 now add 2px space for Layout to improve some readability which might make the situation a bit better.

TylerTemp commented 1 month ago

Hi @KamilTheDev , please try version 3.2.1 for this feature.

image

public string start;

[LayoutGroup("Group", ELayout.FoldoutBox, marginTop: 10, marginBottom: 10)]
public string group1;
public string group2;
public string group3;
[LayoutEnd("Group")]

public string middle;

[Layout("Layout", ELayout.TitleBox, marginTop: 10, marginBottom: 10)] public string layout1;
[Layout("Layout")] public string layout2;
[Layout("Layout")] public string layout3;

public string end;

[Serializable]
public struct MyStruct
{
    public string start;

    [LayoutGroup("Group", ELayout.FoldoutBox, marginTop: 10, marginBottom: 10)]
    public string group1;
    public string group2;
    public string group3;
    [LayoutEnd("Group")]

    public string middle;

    [Layout("Layout", ELayout.TitleBox, marginTop: 10, marginBottom: 10)] public string layout1;
    [Layout("Layout")] public string layout2;
    [Layout("Layout")] public string layout3;

    public string end;
}

[SaintsRow] public MyStruct myStruct;
TylerTemp commented 1 month ago

This issue is now closed as it's been implemented. If you still face similar issue, comment below and I'll open it again.