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();
     }
 }
Esempio n. 2
0
 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();
     }
 }
Esempio n. 3
0
 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;
     }
 }
Esempio n. 4
0
        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();
            }
        }
Esempio n. 5
0
        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;
        }