void DrawGenericButton(ref Rect rect, GUIContent content, Action callback) { rect.width = GetClampedButtonSize(rect.height, content.image.width); if (GUIUtils.DrawCenteredButton(rect, content, Color.clear)) { callback(); } }
void DrawRemoveButton(ref Rect rect) { rect.width = removeContent.image.width; rect.height = height - textSize.y + timeStampSize.y - DevConsole.settings.entriesSpacing * 2; if (GUIUtils.DrawCenteredButton(rect, removeContent, Color.clear)) { Remove(); } }
void DrawStackTraceToggle(ref Rect rect) { rect.width = stackTraceContent.image.width; rect.height = height - textSize.y + timeStampSize.y - DevConsole.settings.entriesSpacing * 2; if (GUIUtils.DrawCenteredButton(rect, stackTraceContent, Color.clear)) { showStackTrace = !showStackTrace; } }
public void Draw(float positionY) { Rect rect = new Rect((Screen.width / 2) / DevConsole.settings.scale - width / 2, positionY, width, height); if (GUIUtils.DrawCenteredButton(rect, new GUIContent(DevConsole.singleton.isOpen?DevConsole.settings.closeConsoleIcon:DevConsole.settings.openConsoleIcon), DevConsole.settings.mainColor)) { DevConsole.singleton.ToggleOpen(); } }
void DrawFoldoutToggle(ref Rect rect) { float oldY = rect.y; rect.width = foldoutCollapsedContent.image.width; rect.height = height - textSize.y + timeStampSize.y - DevConsole.settings.entriesSpacing * 2; bool expand = false; if (builder.needsExpandToggle) { expand = isExpanded; if (GUIUtils.DrawCenteredButton(rect, isExpanded ? foldoutExpandedContent : foldoutCollapsedContent, Color.clear)) { expand = !isExpanded; } } isExpanded = expand; rect.y = oldY; }