[EnumToggleButtons] and [EnumPaging] disregard [LabelText] on enum values

Issue #815 resolved
Linard Hug created an issue

1. The Labels of enum values are not changed in the inspector using [LabelText] for fields using [EnumToggleButtons] or [EnumPaging].

2. Create this enum

private enum Dimension
{
    [LabelText("1D")]
    OneDimensional,
    [LabelText("2D")]
    TwoDimensional,
}

Create a MonoBehaviour script with these three fields and attach it to an empty GameObject

[SerializeField] private Dimension dimension;

[EnumToggleButtons] [SerializeField] private Dimension dimension1;

[EnumPaging] [SerializeField] private Dimension dimension2;

3. Screenshot shows the disregard for [LabelText] and what you should see when following 2.

4. 2020.3.20f1

5. 3.0.12.0

6. No

7. Windows 10 21H1 (19043.1288)

Comments (6)

  1. Antonio Rafael Antunes Miranda

    This is intended behavior, but it would be nice if the EnumToggleButtons attribute also supported the LabelText attribute so I’ll mark this as an enhancement 🙂

  2. Antonio Rafael Antunes Miranda

    Even though it's been a while, a small update: EnumToggleButtons now support the LabelText attribute, including the addition of icons. This feature has been available for some time now, but for completeness, I'm updating this issue and marking it as resolved. Thank you for the feedback.

  3. Log in to comment