protected virtual void DrawItem(MemoryElement memoryElement, ref int row, int indent) { bool isSelected = m_MemorySelection.isSelected(memoryElement); DrawBackground(row, isSelected); Rect rect = GenerateRect(row); rect.x = kBaseIndent + indent * kIndentPx - kFoldoutSize; Rect toggleRect = rect; toggleRect.width = kFoldoutSize; if (memoryElement.ChildCount() > 0) { memoryElement.expanded = GUI.Toggle(toggleRect, memoryElement.expanded, GUIContent.none, styles.foldout); } rect.x += kFoldoutSize; if (isSelected) { m_SelectionOffset = row * kRowHeight; } if (Event.current.type == EventType.MouseDown && rect.Contains(Event.current.mousePosition)) { RowClicked(Event.current, memoryElement); } DrawData(rect, memoryElement, indent, row, isSelected); if (memoryElement.expanded) { DrawRecursiveData(memoryElement, ref row, indent + 1); } }