Show If Attribute

ShowIf is used on any property and can hide the property in the inspector. Use this to hide irrelevant properties based on the current state of the object.

// Note that you can also reference methods and properties or use @expressions. You are not limited to fields.
public UnityEngine.Object SomeObject;

public InfoMessageType SomeEnum;

public bool IsToggled;

[ShowIf("SomeEnum", InfoMessageType.Info)]
public Vector3 Info;

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

[ShowIf("SomeEnum", InfoMessageType.Error)]
public Vector3 Error;

public Vector2 VisibleWhenToggled;

public Vector3 HiddenWhenToggled;

public Vector3 ShowWhenNull;

public Vector3 HideWhenNull;

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