protected override void LayoutPropertyField()

in Scripts/Editor/Windows/PropertyDrawers/WitIntentPropertyDrawer.cs [40:69]


        protected override void LayoutPropertyField(FieldInfo subfield, SerializedProperty subfieldProperty, GUIContent labelContent, bool canEdit)
        {
            // Handle all the same except entities
            if (canEdit || !string.Equals(subfield.Name, "entities"))
            {
                base.LayoutPropertyField(subfield, subfieldProperty, labelContent, canEdit);
                return;
            }

            // Entity foldout
            subfieldProperty.isExpanded = WitEditorUI.LayoutFoldout(labelContent, subfieldProperty.isExpanded);
            if (subfieldProperty.isExpanded)
            {
                EditorGUI.indentLevel++;
                if (subfieldProperty.arraySize == 0)
                {
                    WitEditorUI.LayoutErrorLabel(WitTexts.Texts.ConfigurationEntitiesMissingLabel);
                }
                else
                {
                    for (int i = 0; i < subfieldProperty.arraySize; i++)
                    {
                        SerializedProperty entityProp = subfieldProperty.GetArrayElementAtIndex(i);
                        string entityPropName = entityProp.FindPropertyRelative("name").stringValue;
                        WitEditorUI.LayoutLabel(entityPropName);
                    }
                }
                EditorGUI.indentLevel--;
            }
        }