| Parameter | Description |
|---|---|
| property | The property that represents the UxmlSerializedData instance. |
VisualElement The root element for the Inspector.
Creates the root element for the property GUI. This method is sealed.
This method is sealed so the binding context stays in place. Override UxmlSerializedDataPropertyDrawer.CreatePropertyGUI, UxmlSerializedDataPropertyDrawer.CreateChildPropertiesGUI, or UxmlSerializedDataPropertyDrawer.CreateChildPropertyGUI to customize the result.
| Parameter | Description |
|---|---|
| container | The parent element to add the content to. |
| property | The serialized property that represents the UXML serialized data instance. |
Creates the property GUI for a UXML serialized data instance.
The default implementation wraps the child properties in a Foldout
with the property display name as its label. Override this method to use a flat layout or a different
container.
The following example replaces the default foldout with a flat layout.
// Override CreatePropertyGUI to replace the default Foldout with a flat layout. [CustomPropertyDrawer(typeof(FlatButton.UxmlSerializedData))] public class FlatButtonDrawer : UxmlSerializedDataPropertyDrawer { protected override void CreatePropertyGUI(VisualElement container, SerializedProperty property) { VisualElement group = new VisualElement(); container.Add(group); if (property.managedReferenceValue != null) CreateChildPropertiesGUI(group, property); } }