Skip to content

Commit 9780ba0

Browse files
committed
Add Begin/EndVerticalAttribute&Drawer
1 parent 080c399 commit 9780ba0

9 files changed

Lines changed: 101 additions & 0 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using UnityEngine;
2+
3+
namespace Toolbox.Editor.Drawers
4+
{
5+
public class BeginVerticalAttributeDrawer : ToolboxDecoratorDrawer<BeginVerticalAttribute>
6+
{
7+
protected override void OnGuiBeginSafe(BeginVerticalAttribute attribute)
8+
{
9+
ToolboxLayoutHelper.BeginVertical();
10+
}
11+
}
12+
}

Assets/Editor Toolbox/Editor/Drawers/Toolbox/Decorator/BeginVerticalAttributeDrawer.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using UnityEngine;
2+
3+
namespace Toolbox.Editor.Drawers
4+
{
5+
public class EndVerticalAttributeDrawer : ToolboxDecoratorDrawer<EndVerticalAttribute>
6+
{
7+
protected override void OnGuiCloseSafe(EndVerticalAttribute attribute)
8+
{
9+
ToolboxLayoutHelper.CloseVertical();
10+
}
11+
}
12+
}

Assets/Editor Toolbox/Editor/Drawers/Toolbox/Decorator/EndVerticalAttributeDrawer.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Assets/Editor Toolbox/EditorSettings.asset

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,14 @@ MonoBehaviour:
5252
- typeReference: Toolbox.Editor.Drawers.BeginHorizontalAttributeDrawer, Toolbox.Editor
5353
- typeReference: Toolbox.Editor.Drawers.BeginHorizontalGroupAttributeDrawer, Toolbox.Editor
5454
- typeReference: Toolbox.Editor.Drawers.BeginIndentAttributeDrawer, Toolbox.Editor
55+
- typeReference: Toolbox.Editor.Drawers.BeginVerticalAttributeDrawer, Toolbox.Editor
5556
- typeReference: Toolbox.Editor.Drawers.DynamicHelpAttributeDrawer, Toolbox.Editor
5657
- typeReference: Toolbox.Editor.Drawers.EditorButtonAttributeDrawer, Toolbox.Editor
5758
- typeReference: Toolbox.Editor.Drawers.EndGroupAttributeDrawer, Toolbox.Editor
5859
- typeReference: Toolbox.Editor.Drawers.EndHorizontalAttributeDrawer, Toolbox.Editor
5960
- typeReference: Toolbox.Editor.Drawers.EndHorizontalGroupAttributeDrawer, Toolbox.Editor
6061
- typeReference: Toolbox.Editor.Drawers.EndIndentAttributeDrawer, Toolbox.Editor
62+
- typeReference: Toolbox.Editor.Drawers.EndVerticalAttributeDrawer, Toolbox.Editor
6163
- typeReference: Toolbox.Editor.Drawers.GuiColorAttributeDrawer, Toolbox.Editor
6264
- typeReference: Toolbox.Editor.Drawers.HelpAttributeDrawer, Toolbox.Editor
6365
- typeReference: Toolbox.Editor.Drawers.HighlightAttributeDrawer, Toolbox.Editor
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using System;
2+
using System.Diagnostics;
3+
4+
namespace UnityEngine
5+
{
6+
/// <summary>
7+
/// Begins vertical layout of properties. Has to be closed by the <see cref="EndVerticalAttribute"/>.
8+
/// </summary>
9+
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false)]
10+
[Conditional("UNITY_EDITOR")]
11+
public class BeginVerticalAttribute : ToolboxDecoratorAttribute
12+
{ }
13+
}

Assets/Editor Toolbox/Runtime/Attributes/Toolbox/DecoratorAttributes/BeginVerticalAttribute.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using System;
2+
using System.Diagnostics;
3+
4+
namespace UnityEngine
5+
{
6+
/// <summary>
7+
/// Use this attribute to close previously created <see cref="BeginVerticalAttribute"/>.
8+
/// </summary>
9+
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false)]
10+
[Conditional("UNITY_EDITOR")]
11+
public class EndVerticalAttribute : ToolboxDecoratorAttribute
12+
{
13+
public EndVerticalAttribute()
14+
{
15+
Order = -1000;
16+
}
17+
}
18+
}

Assets/Editor Toolbox/Runtime/Attributes/Toolbox/DecoratorAttributes/EndVerticalAttribute.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)