Documentation

Unity Engine


Unity Engine


Init(VisualElement, IUxmlAttributes, CreationContext)

Initialize a VisualElement instance with values from the UXML element attributes.
Read time 1 minuteLast updated a month ago

Definition

Warning
Deprecated. UxmlTraits is deprecated and will be removed. Use UxmlElementAttribute instead.
public virtual void Init(VisualElement ve, IUxmlAttributes bag, CreationContext cc)

Parameters

The VisualElement to initialize.

A bag of name-value pairs, one for each attribute of the UXML element.

When the element is created as part of a template instance inserted in another document, this contains information about the insertion point.

Remarks

Override this function in your traits class to initialize your C# object with values read from the UXML document.