protected virtual void LayoutPropertyField()

in Scripts/Editor/Windows/PropertyDrawers/WitPropertyDrawer.cs [184:205]


        protected virtual void LayoutPropertyField(FieldInfo subfield, SerializedProperty subfieldProperty,  GUIContent labelContent, bool canEdit)
        {
            // If can edit or not array default layout
            if (canEdit || !subfield.FieldType.IsArray || subfieldProperty.arraySize <= 0)
            {
                EditorGUILayout.PropertyField(subfieldProperty, labelContent);
                return;
            }

            // If cannot edit, handle here
            subfieldProperty.isExpanded = WitEditorUI.LayoutFoldout(labelContent, subfieldProperty.isExpanded);
            if (subfieldProperty.isExpanded)
            {
                EditorGUI.indentLevel++;
                for (int i = 0; i < subfieldProperty.arraySize; i++)
                {
                    SerializedProperty p = subfieldProperty.GetArrayElementAtIndex(i);
                    EditorGUILayout.PropertyField(p);
                }
                EditorGUI.indentLevel--;
            }
        }