GenerateVisualContentAttribute
Declares a static method of a VisualElementComponentAttribute struct as a painter that contributes to the owner element's _generateVisualContent.
Read time 3 minutesLast updated 10 days ago
Definition
- Type: Class
- Namespace: UnityEngine.UIElements
- Assembly: UnityEngine.UIElementsModule
- Inherits from: Attribute
[AttributeUsage(AttributeTargets.Method, Inherited = false)]public class GenerateVisualContentAttribute : Attribute
Remarks
The method must be . The source generator hooks it into the owner's 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.
static void M(ref T self, <see cref="UnityEngine.UIElements.MeshGenerationContext"></see> mgc)generateVisualContent