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

using AdvancedInspector;

[AdvancedInspector]
public class AIExample14_Background : MonoBehaviour 
{
    // The background attribute is simply used to stored a color for the background of an expandable item.
    [Inspect, Background(1, 0.5f, 0)]
    public ExpandableClass myObject;

    [AdvancedInspector, Serializable]
    public class ExpandableClass
    {
        [Inspect]
        public float myField;
    }

    // It can also be dynamic.
    [Inspect, Background("GetBackgroundColor")]
    public float[] myArray;

    [Inspect]
    public Color color;

    private Color GetBackgroundColor()
    {
        return color;
    }
}