It's not easy to specifically explain what the problem is, and the code through which the problem could be originating is extensive, and I am uncertain how to narrow it down beyond what I already have, given the extensive nature of the potentially problematic code, I have uploaded the code to Github, the best explanation I can provide is that when attempting to 'expand' on the 'NamePart' fields, it changes the name of the main field, adds an empty line between the dropdown and the field, and after the field, but does not display the fields of 'NamePart', the 'FamilyNames' field displays properly however, the code can be found here.
I have tried validating that the property drawers are setup properly, and that all fields are appropriately serialized, but I don't know what is even causing the problem let alone how to fix it.
The relevant sections of the code are below. First, in specifically the name generator property drawer:
protected override void DrawProperty ( Rect position, SerializedProperty property, GUIContent label, bool isPolymorphic )
{
EditorGUI.BeginProperty ( position, label, property );
Rect pos = new ( position.x, position.y, position.width, EditorGUI.GetPropertyHeight ( property.FindPropertyRelative ( "m_Feminine" ) ) );
EditorGUI.PropertyField ( pos, property.FindPropertyRelative ( "m_Feminine" ));
pos.y += pos.height + EditorGUIUtility.standardVerticalSpacing;
pos.height = EditorGUI.GetPropertyHeight ( property.FindPropertyRelative ( "m_Masculine" ) );
EditorGUI.PropertyField ( pos, property.FindPropertyRelative ( "m_Masculine" ));
pos.y += pos.height + EditorGUIUtility.standardVerticalSpacing;
pos.height = EditorGUI.GetPropertyHeight ( property.FindPropertyRelative ( "m_Neutral" ) );
EditorGUI.PropertyField ( pos, property.FindPropertyRelative ( "m_Neutral" ));
pos.y += pos.height + EditorGUIUtility.standardVerticalSpacing;
pos.height = EditorGUI.GetPropertyHeight ( property.FindPropertyRelative ( "m_FamilyNames" ) );
EditorGUI.PropertyField ( pos, property.FindPropertyRelative ( "m_FamilyNames" ) );
EditorGUI.EndProperty ();
}
And also, in the polymorphic property drawer:
public sealed override void OnGUI ( Rect position, SerializedProperty property, GUIContent label )
{
// ...
if (reference != null && propertyHeight > 0)
{
property.isExpanded = EditorGUI.Foldout ( labelRect, property.isExpanded, property.displayName, true );
}
else
{
EditorGUI.LabelField ( labelRect, label );
}