StylePropertyAttribute
Binds a field or property of a component struct to a custom USS property.
Read time 3 minutesLast updated 6 days ago
Definition
- Type: Class
- Namespace: UnityEngine.UIElements
- Assembly: UnityEngine.UIElementsModule
- Inherits from: Attribute
[AttributeUsage(AttributeTargets.Property|AttributeTargets.Field, Inherited = false)]public class StylePropertyAttribute : Attribute
Remarks
Apply this attribute to a field or property of a struct that has the VisualElementComponentAttribute. The member receives the value of the custom USS property resolved on the element the component is attached to, so a style sheet can drive component data.
Fields
Value | Description |
|---|---|
| name | The custom USS property name, for example |
Constructors
Constructor | Description |
|---|---|
| StylePropertyAttribute(System.String) | Initializes a new instance of the StylePropertyAttribute class. |