Version: Unity 6.7 Alpha (6000.7)
LanguageEnglish
  • C#

UxmlSerializedDataPropertyDrawer.CreateChildPropertiesGUI

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

protected void CreateChildPropertiesGUI(VisualElement container, SerializedProperty property);

Parameters

Parameter Description
container The parent element to add the fields to.
property The serialized property that represents the UXML serialized data instance.

Description

Creates a field for each visible attribute of the UXML serialized data.

The default implementation calls UxmlSerializedDataPropertyDrawer.CreateChildPropertyGUI for each visible attribute, in declaration order. Override this method to show only specific attributes or to change their order. Call UxmlSerializedDataPropertyDrawer.CreateChildPropertiesExcluding to exclude specific attributes by name whilst keeping the default order and property drawers for the rest.

The following example shows only specific attributes by name.

// Override CreateChildPropertiesGUI to display only specific properties.
[CustomPropertyDrawer(typeof(SelectiveButton.UxmlSerializedData))]
public class SelectiveButtonDrawer : UxmlSerializedDataPropertyDrawer
{
    protected override void CreateChildPropertiesGUI(VisualElement container, SerializedProperty property)
    {
        CreateChildPropertiesIncluding(container, property, "color", "text");
    }
}