In OdinPropertyProcessor -> ProcessMemberProperties, adding the attribute ReadOnlyAttribute does not make the property readonly, DisableIfAttribute("@true") works

Issue #747 new
Bob Giezi created an issue

In OdinPropertyProcessor -> ProcessMemberProperties, adding the attribute ReadOnlyAttribute does not make the property readonly, DisableIfAttribute("@true") works:

public class MyClassProcessor : OdinPropertyProcessor<MyClass>
{
    public override void ProcessMemberProperties(List<InspectorPropertyInfo> propertyInfos)
    {

        foreach (InspectorPropertyInfo propertyInfo in propertyInfos)
        {
            propertyInfo.GetEditableAttributesList().Add(new DisableIfAttribute("@true")); // works as readonly is intended to work
            propertyInfo.GetEditableAttributesList().Add(new Sirenix.OdinInspector.ReadOnlyAttribute()); // does not work
        }
    }
}

Comments (1)

  1. Log in to comment