Skip to content

Instantly share code, notes, and snippets.

@ababilinski
Created July 24, 2020 17:27
Show Gist options
  • Save ababilinski/853f381c16a7d8e591f898549e8df03f to your computer and use it in GitHub Desktop.
Save ababilinski/853f381c16a7d8e591f898549e8df03f to your computer and use it in GitHub Desktop.
A script for drawing horizontal lines inside of the Unity Editor
#if UNITY_EDITOR
using UnityEditor;
using UnityEngine;
public static class EditorGuiUtility
{
public static void DrawUILine(Color color, int thickness = 2, int padding = 10)
{
Rect r = EditorGUILayout.GetControlRect(GUILayout.Height(padding+thickness));
r.height = thickness;
r.y+=padding/2;
r.x-=2;
r.width +=6;
EditorGUI.DrawRect(r, color);
}
}
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment