DecoratedPropertyAttribute

Class in ChivalrousGames.Common.Inspector / Inherits from PropertyAttribute

Description

Property attribute class designed to use multiple PropertyDecorators to modify behavior and decorate fields displayed in the Unity inspector. The Property Attribute must always be used with at least one PropertyDecorator.

Usage Example

[DecoratedProperty(
	typeof(MinFloatValuePropertyDecorator), 0f,
	typeof(MaxFloatValuePropertyDecorator), 360f)]
public float min;
//The DecoratedPropertyAttribute is used to decorate the "min" field with both a MinFloatValue property decorator and a MaxFloatValue property decorator.
//Both decorators in this case expect a single parameter. The parameters for a decorator are passed after the decorator itself is passed.

Constructors

Constructor
public DecoratedPropertyAttribute(params object[] propertyDecoratorAndParameters);
Parameters
propertyDecoratorAndParameters object[] An array of objects containing property decorator types and their parameters, following pattern: typeof(MyDecorator1), MyDecoratorParam1, MyDecoratorParamN, typeof(MyDecoratorN), etc.
Return
DecoratedPropertyAttribute A new instance of DecoratedPropertyAttribute