From ec71246cbd7acf2a848945bf77a6bdd67f950e79 Mon Sep 17 00:00:00 2001 From: VladV Date: Sun, 12 Mar 2023 01:32:53 +0400 Subject: [PATCH] Add HorizontalLine to Title attribute --- Editor.Extras/Drawers/TitleDrawer.cs | 6 +++++- Runtime/Attributes/TitleAttribute.cs | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Editor.Extras/Drawers/TitleDrawer.cs b/Editor.Extras/Drawers/TitleDrawer.cs index bcd83a3..678f02a 100644 --- a/Editor.Extras/Drawers/TitleDrawer.cs +++ b/Editor.Extras/Drawers/TitleDrawer.cs @@ -63,7 +63,11 @@ public override void OnGUI(Rect position, TriProperty property, TriElement next) var title = _titleResolver.GetValue(property, "Error"); GUI.Label(titleRect, title, EditorStyles.boldLabel); - EditorGUI.DrawRect(lineRect, Color.gray); + + if (Attribute.HorizontalLine) + { + EditorGUI.DrawRect(lineRect, Color.gray); + } next.OnGUI(contentRect); } diff --git a/Runtime/Attributes/TitleAttribute.cs b/Runtime/Attributes/TitleAttribute.cs index 6a408a6..4baa53c 100644 --- a/Runtime/Attributes/TitleAttribute.cs +++ b/Runtime/Attributes/TitleAttribute.cs @@ -8,6 +8,7 @@ namespace TriInspector public sealed class TitleAttribute : Attribute { public string Title { get; } + public bool HorizontalLine { get; set; } = true; public TitleAttribute(string title) {