AlternateLabelBooleanPropertyDecorator

Class in ChivalrousGames.Common.Inspector / Inherits from PropertyDecorator

Description

Allows to change the label of a property in the inspector based on another property’s boolean value. The decorator expects 3 string params: the name of the boolean field that causes label text change, the label text when boolean field is true and the label text when boolean field is false.

Usage Example

[DecoratedProperty(typeof(AlternateLabelBooleanPropertyDecorator), "uniform", "Random", "Random X")]
public FloatRange randomX;
/*This means that if the property "uniform" has value "true", the property "randomX" will display label 
"Random" in the Unity inspector. Otherwise, the label "Random X" will be displayed.*/