UIElements.PropertyField should pass label value to to EditorGUIlayoiut.PropertyField

Hi. When you create a UIElements.PropertyField, if the field has a property drawer implementation using IMGUI, the property field will automatically create a IMGUIContainer to display the property drawer. But, the label of the property field is ignored (it’s always displaying the field name).

After a quick look at the source code of PropertyField, problem seems to be in the Reset method of PropertyField.cs :

EditorGUILayout.PropertyField(m_SerializedProperty, true);

Should be that instead :

EditorGUILayout.PropertyField(m_SerializedProperty, new GUIContent(label), true);

Setting the UIElement tooltip seems to work so I don’t think it needs to be passed through the GUIContent.

As the fix seems easy to implement, is there a chance to see it implemented in a future version of Unity ? It can be important to facilitate transition from IMGUI to UIElements (and backward compatibility).

2 Likes

Yep. This needs to be fixed. I’ve added tracking internally for this bug. Should qualify for 2019.3 backporting once fixed.

1 Like