summaryrefslogtreecommitdiff
path: root/Assets/ThirdParty/AdvancedInspector/Examples/CSharp/AIExample12_Group.cs
blob: d01bcc106e177593a0557205ce24d2652a0630ca (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
using UnityEngine;
using System.Collections;

using AdvancedInspector;

[AdvancedInspector]
public class AIExample12_Group : MonoBehaviour 
{
    // Item can be grouped using the Group attribute;
    [Inspect, Group("My First Group")]
    public float myFirstField;

    [Inspect, Group("My First Group")]
    public float MyFirstProperty
    {
        get { return myFirstField; }
        set { myFirstField = value; }
    }

    // Flagging it false stops the chaining.
    [Inspect, Group("My First Group")]
    public void MyFirstMethod()
    {
        myFirstField++;
    }

    // Grouping is done with similar names.
    // The second parameter is the order in which the different groups are shown.
    [Inspect, Group("My Second Group", 1, Description = "This is some extra text.")]
    public float mySecondField;

    [Inspect, Group("My Second Group")]
    public float MySecondProperty
    {
        get { return mySecondField; }
        set { mySecondField = value; }
    }

    [Inspect, Group("My Second Group")]
    public void MySecondMethod()
    {
        mySecondField++;
    }
}