dbrizov / NaughtyAttributes

Attribute Extensions for Unity
MIT License
4.53k stars 464 forks source link

[Issue]Field immutable, When using [Expandable] and [ShowIf] #298

Closed LastAssertor closed 2 years ago

LastAssertor commented 2 years ago
[CreateAssetMenu(fileName = "NewObj", menuName = "ScriptableObjects/Test_Expandable1")]
    public class Test_Expandable1 : ScriptableObject
    {
        public enum AAA
        {
            A,
            B,
            C
        }

        public AAA a;// When a is equal to AAA.A, a cannot be changed
        [ShowIf("isA")]
        [Expandable]// Comment this line, then a can be changed
        public Test_Expandable2 d;
        public bool isA => a == AAA.A;
    }

Unity Version : 2021.2.10f1 NaughtyAttributes Version : 2.1.1 OS : Windows 10

dbrizov commented 2 years ago

Update to 2.1.2. I just merged a PR that fixes it - #295