TylerTemp / SaintsField

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

Support Indent for Layout #21

Closed laurentopia closed 4 months ago

laurentopia commented 4 months ago

Anything to give a common background and even indentation to a group of fields?

TylerTemp commented 4 months ago

A boxGroup function is mixed with layout. Ensure you enabled SaintsEditor before testing this example:

using UnityEngine;
using SaintsField.Playa;
using SaintsField;

namespace SaintsField.Samples.Scripts.IssueAndTesting.Issue
{
    public class Issue21 : MonoBehaviour
    {
        public string beforeBox1;

        [Layout("The Lonesome Crowded West", ELayout.Background | ELayout.Title | ELayout.TitleOut)]
        public string s1;
        [Layout("The Lonesome Crowded West")]
        public string s2;

        public string afterBox1;

        [SepTitle(EColor.Gray)]

        public string beforeBox2;

        [Layout("Strangers to Ourselves", ELayout.Background | ELayout.Title | ELayout.TitleOut | ELayout.Foldout)]
        public string s3;
        [Layout("Strangers to Ourselves")]
        public string s4;

        public string afterBox2;
    }
}

image


For indentation it's not supported yet. Do you mean indent horizontal (like Unity's indent) or vertical (like Unity's [Space])? I might add it if it's a reasonable request (and not too complex)


Edit:

It's not complex to add it to normal field and layout system. But as it need to be added in both normal field and layout, in both IMGUI and UIToolkit, this feature might not be quick to be added.

Currently my working order is:

  1. Support Enum for Show/Hide/Enable/Disable-If
  2. Support array/list for ShowInInspector
  3. ... (not decided yet)

So please stay tuned.

laurentopia commented 4 months ago

Fantastic! Thanks.