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

using AdvancedInspector;

[AdvancedInspector]
public class AIExample2_Inspect : MonoBehaviour 
{
    // The Inspector attribute is used to display something by the Advanced Inspector.
    // By default, everything is hidden.
    [Inspect]
    public float myField;

    // Properties can also be inspected.
    [Inspect]
    public float MyProperty
    {
        get { return myField; }
        set { myField = value; }
    }

    // Method/Functions without input parameters can also be inspected.
    // They show up as a button.
    [Inspect]
    public void MyMethod()
    {
        myField++;
    }
}