기술 자료

Unity Engine

Unity Engine

StylePropertyAttribute

Binds a field or property of a component struct to a custom USS property.
읽는 시간 3분최근 업데이트: 한 달 전

Definition

[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

nameThe custom USS property name, for example
"--my-color"
.

Constructors

Constructor

Description

StylePropertyAttribute(System.String)Initializes a new instance of the StylePropertyAttribute class.

Inheritance

Inherited Members