public void DrawLog() { using (GUIFoldOut.Create(this, "Log")) { if (!GUIFoldOut.GetState(this, "Log")) { return; } using (GUIScrollView.Create(ref _logScrollPos)) { for (var i = EventHandler.Logs.Count - 1; i >= 0; i--) { var log = EventHandler.Logs[i]; if (!string.IsNullOrEmpty(_searchEventType) && !log.EventType.Contains(_searchEventType)) { return; } if (log.Success) { EditorGUILayout.TextArea(log.ToString()); } else { using (GUIContentColorArea.Create(Color.red)) { EditorGUILayout.TextArea(log.ToString()); } } } } } }
public void DrawEventTable() { using (GUIFoldOut.Create(this, "Event")) { if (!GUIFoldOut.GetState(this, "Event")) { return; } using (GUIScrollView.Create(ref _tableScrollPos, GUILayout.Height(Screen.height * 0.6f / EditorGUIUtility.pixelsPerPoint))) { var tableWidth = (Screen.width - 58f * EditorGUIUtility.pixelsPerPoint) / EditorGUIUtility.pixelsPerPoint; using (new GUITable <EventHandler>( _tableHeaders, (rowIndex, columnWidths, eventHandler) => { if (!string.IsNullOrEmpty(_searchEventType) && !eventHandler.EventType.ToString().Contains(_searchEventType)) { return; } using (new GUIFullColorArea(GetRowColor(eventHandler))) { using (new GUITableRow(rowIndex)) { for (var i = 0; i < _tableCellDrawers.Length; i++) { var cellWidth = columnWidths[i]; using (new GUITableCell(rowIndex, i, cellWidth)) { _tableCellDrawers[i](rowIndex, cellWidth, eventHandler); } } } } }, ForeachRow(), tableWidth, _tableCellWidthWeights) ) { GUI.enabled = true; } } } }