Tri-Inspector/Editor/Utilities/TriEditorGUI.cs

23 lines
738 B
C#
Raw Normal View History

2021-12-07 10:20:36 -05:00
using UnityEditor;
using UnityEngine;
namespace TriInspector.Utilities
{
public static class TriEditorGUI
{
public static void Foldout(Rect rect, TriProperty property)
{
var content = property.DisplayNameContent;
property.IsExpanded = EditorGUI.Foldout(rect, property.IsExpanded, content, true);
}
public static void DrawBox(Rect position, GUIStyle style,
bool isHover = false, bool isActive = false, bool on = false, bool hasKeyboardFocus = false)
{
if (Event.current.type == EventType.Repaint)
{
style.Draw(position, GUIContent.none, isHover, isActive, on, hasKeyboardFocus);
}
}
}
}