BetterSpacing

SpacingAttribute.cs

namespace Sirenix.OdinInspector { using System; using UnityEngine; /// /// Spacing is used to inject space before and/or after field rendering. /// [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Method)] [DontApplyToListElements] public class SpacingAttribute : Attribute { /// /// The amount of space that should be added before field rendering. /// public int Before { get; set; } /// /// The amount of space that should be added after field rendering. /// public int After { get; set; } public SpacingAttribute { } public SpacingAttribute(int after) { this.After = after; } public SpacingAttribute(int before, int after) { this.After = after; this.Before = before; } } }

SpacingAttributeDrawer.cs namespace Sirenix.OdinInspector.Editor.Drawers {    using Utilities.Editor; using UnityEngine; ///     /// Draws properties marked with . /// Adds GUILayout.Space before and/or after field rendering, while maintaining any drawers further down in the drawer chain. ///     [OdinDrawer] [DrawerPriority(DrawerPriorityLevel.SuperPriority)] public sealed class SpacingAttributeDrawer : OdinAttributeDrawer {        ///          /// Draws the attribute. ///         protected override void DrawPropertyLayout(InspectorProperty property, SpacingAttribute attribute, GUIContent label) {            GUILayout.Space(attribute.Before); this.CallNextDrawer(property, label); GUILayout.Space(attribute.After); }    } }
 * 1) if UNITY_EDITOR
 * 1) endif

Usage: [Spacing(Before = 5)] public int AddSpacingBefore = 0;