2023-07-04 23:34:54 +02:00
|
|
|
using UnityEditor;
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
namespace VertexColor.ScenePartition.Editor
|
|
|
|
{
|
|
|
|
public static class EditorGUIUtils
|
|
|
|
{
|
|
|
|
public static readonly Color horizontalLineColor = Color.white;
|
|
|
|
|
|
|
|
public static void HorizontalLine(Color color)
|
|
|
|
{
|
|
|
|
Color prev = GUI.color;
|
|
|
|
GUI.color = color;
|
|
|
|
EditorGUILayout.LabelField("", GUI.skin.horizontalSlider);
|
|
|
|
GUI.color = prev;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void HorizontalLine() => HorizontalLine(horizontalLineColor);
|
2023-07-09 23:01:48 +02:00
|
|
|
|
2023-07-30 00:22:39 +02:00
|
|
|
public struct FoldoutHeaderScope : System.IDisposable
|
2023-07-09 23:01:48 +02:00
|
|
|
{
|
|
|
|
public FoldoutHeaderScope(string label, ref bool foldout)
|
|
|
|
{
|
|
|
|
foldout = EditorGUILayout.BeginFoldoutHeaderGroup(foldout, label);
|
|
|
|
}
|
|
|
|
|
2023-07-30 00:22:39 +02:00
|
|
|
public readonly void Dispose()
|
2023-07-09 23:01:48 +02:00
|
|
|
{
|
|
|
|
EditorGUILayout.EndFoldoutHeaderGroup();
|
|
|
|
}
|
|
|
|
}
|
2023-07-04 23:34:54 +02:00
|
|
|
}
|
|
|
|
}
|