private void RenderLabels() { if (_groups == null) { return; } GUI.color = Color.black; foreach (Group group in _groups.Values) { if (Utility2.IsInside(group._position, _ZoomArea.shownArea)) { if (_selectedItem != null && _selectedItem._group == group) { RenderGroupItems(group); } else { RenderGroupLabel(group); } } } GUI.color = Color.white; }
private void RenderGroupItems(Group group) { Matrix4x4 mat = _ZoomArea.drawingToViewMatrix; foreach (Item item in group._items) { if (Utility2.IsInside(item._position, _ZoomArea.shownArea)) { Vector3 p1 = mat.MultiplyPoint(new Vector3(item._position.xMin, item._position.yMin)); Vector3 p2 = mat.MultiplyPoint(new Vector3(item._position.xMax, item._position.yMax)); if (p2.x - p1.x > 30f) { Rect rect = new Rect(p1.x, p2.y, p2.x - p1.x, p1.y - p2.y); string row1 = item._group._name; string row2 = EditorUtility.FormatBytes(item.memorySize); GUI.Label(rect, row1 + "\n" + row2); } } } }