summaryrefslogtreecommitdiff
path: root/Assets/UI_Extension/Editor/GUIUtils.cs
blob: 5b881c6c8cd0b67b0887e4eb28017c565c74f776 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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);
        }

    }
}