Unity-MoreAttributes

A set of custom attributes


Project maintained by kevincastejon Hosted on GitHub Pages — Theme by mattgraham

ShowPropIf

Shows or hides a property on the inspector based on another serialized bool property value.

How to use

Put the attribute in front of a property.

Examples

[SerializeField] private bool _canBeKilled;
[SerializeField][ShowPropIf("_canBeKilled")] private int _healthPoints;
[SerializeField] private bool _hasInfiniteAmmo;
[SerializeField][ShowPropIf("_hasInfiniteAmmo", false)] private int _ammoCount;