protected virtual void DrawChildren(Rect rect) { if (hideGroup) { foreach (var child in children) { child.Draw(ref rect); } } else { var r2 = rect; const int r2Padding = 15; r2.width = EditorGUIUtility.labelWidth - r2Padding; r2.x += r2Padding; EditorGUI.LabelField(r2, GetFoldoutName()); using (var foldout = new FoldoutBlock(this, new Rect(rect.x, rect.y, rect.width, ReflectionDrawerStyles.singleLineHeight), GUIContent.none)) { rect.y += ReflectionDrawerStyles.singleLineHeight; if (foldout.isUnFolded) { using (var indent = new IndentBlock(rect)) { foreach (var child in children) { child.Draw(ref indent.rect); } } } } } }
protected override object DrawInternal(Rect rect) { if (hideGroup) { DrawChildren(ref rect); if (drawAddButton) { DrawArrayAddButton(rect); } } else { using (var foldout = new FoldoutBlock(this, rect, new GUIContent(fieldName))) { rect.y += ReflectionDrawerStyles.singleLineHeight; if (foldout.isUnFolded) { using (var indent = new IndentBlock(rect)) { DrawChildren(ref indent.rect); if (drawAddButton) { DrawArrayAddButton(indent.rect); } } } } } return(value); }