summaryrefslogtreecommitdiff
path: root/Assets/Plugins/AdvancedInspector/Attributes/Space.cs
blob: 02972663770ac4a6ebb0c7a4bdc413c026589d1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
using System;

namespace AdvancedInspector
{
    /// <summary>
    /// Add a space after the current fields.
    /// </summary>
    [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property | AttributeTargets.Method)]
    public class SpacingAttribute : Attribute
    {
        private int before = 0;

        /// <summary>
        /// Size of the space to add before the item.
        /// Default is 0.
        /// </summary>
        public int Before
        {
            get { return before; }
            set { before = value; }
        }

        private int after = 0;

        /// <summary>
        /// Size of the space to add after the item.
        /// Default is 1.
        /// </summary>
        public int After
        {
            get { return after; }
            set { after = value; }
        }

        public SpacingAttribute() { }

        public SpacingAttribute(int after)
        {
            this.after = after;
        }

        public SpacingAttribute(int before, int after)
        {
            this.after = after;
            this.before = before;
        }
    }
}