From d07e14add74e017b52ab2371efeea1aa4ea10ced Mon Sep 17 00:00:00 2001 From: chai Date: Sat, 8 May 2021 23:15:13 +0800 Subject: +init --- Assets/UI_Extension/Editor/GUIUtils.cs | 37 ++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 Assets/UI_Extension/Editor/GUIUtils.cs (limited to 'Assets/UI_Extension/Editor/GUIUtils.cs') diff --git a/Assets/UI_Extension/Editor/GUIUtils.cs b/Assets/UI_Extension/Editor/GUIUtils.cs new file mode 100644 index 0000000..5b881c6 --- /dev/null +++ b/Assets/UI_Extension/Editor/GUIUtils.cs @@ -0,0 +1,37 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEditor; + +namespace UIExt +{ + internal static class GUIUtils + { + + public static void DrawLine() + { + + } + + public static void DrawHorizontalline(Color color, Vector2 left, float length, int thickness = 1, int padding = 0) + { + Rect r = EditorGUILayout.GetControlRect(GUILayout.Height(padding + thickness)); + r.x = left.x; + r.y = left.y; + r.width = length; + EditorGUI.DrawRect(r, color); + GUILayout.Space(-10f); + } + + public static void DrawVerticleline(Color color, Vector2 top, float height, int thickness = 1, int padding = 0) + { + Rect r = EditorGUILayout.GetControlRect(GUILayout.Width(padding + thickness)); + r.x = top.x; + r.y = top.y; + r.height = height; + EditorGUI.DrawRect(r, color); + GUILayout.Space(-10f); + } + + } +} -- cgit v1.1-26-g67d0