기술 자료

Unity Engine

Unity Engine

GenerateVisualContentAttribute

Declares a static method of a VisualElementComponentAttribute struct as a painter that contributes to the owner element's VisualElement.generateVisualContent.
읽는 시간 3분최근 업데이트: 20일 전

Definition

[AttributeUsage(AttributeTargets.Method, Inherited = false)]public class GenerateVisualContentAttribute : Attribute

Remarks

The method must be
static void M(ref T self, <see cref="UnityEngine.UIElements.MeshGenerationContext"></see> mgc)
. The source generator hooks it into the owner's
generateVisualContent
when the component is added and unhooks it when the component is removed, and requests an initial repaint. Geometry changes re-run the painter through the engine, and [StyleProperty] changes repaint via the generated style handler, so no extra callbacks are needed.

Inheritance

Inherited Members