Skip to content

ShowInInspector: Range attribute not evaluated for sub-fields #186

Description

@breeky-dev

Describe the bug
When using the ShowInInspector attribute on a reference type, the type sub fields attribute do not work correctly.

Expected behavior
In the code sample below, the int field 'MyInt' is not displayed with a slider as expected.

Code Sample

    public class AttributeTester : MonoBehaviour
    {
        [SerializeReference]
        public A a;
        
        [ShowInInspector]
        public A PropertyA
        {
            get => a;
            set => a = value;
        }
    }

    [Serializable]
    public class A
    {
        [Range(0, 10)]
        public int MyInt;
    }

Screenshots

Image

Desktop: Windows 11
Unity version: 6
Tri Inspector version: 1.14.1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions