Disable If Attribute

DisableIf is used on any property, and can disable or enable the property in the inspector. Use this to disable properties when they are irrelevant.

public UnityEngine.Object SomeObject;

public InfoMessageType SomeEnum;

public bool IsToggled;

[DisableIf("SomeEnum", InfoMessageType.Info)]
public Vector2 Info;

[DisableIf("SomeEnum", InfoMessageType.Error)]
public Vector2 Error;

[DisableIf("SomeEnum", InfoMessageType.Warning)]
public Vector2 Warning;

public int DisableIfToggled;

public Vector3 EnabledWhenNull;

[DisableIf("@this.IsToggled && this.SomeObject != null || this.SomeEnum == InfoMessageType.Error")]
public int DisableWithExpression;