summaryrefslogtreecommitdiff
path: root/Assets/ThirdParty/AdvancedInspector/Examples/CSharp/AIExample22_DisplayAsParent.cs
blob: 02ffca4748cd3abd2238ad2dbe2dda2af7fbd871 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
using UnityEngine;
using System;
using System.Collections;

using AdvancedInspector;

[AdvancedInspector]
public class AIExample22_DisplayAsParent : MonoBehaviour 
{
    // The DisplayAsParent attribute prevents a sub-object from being expandable
    // Instead it display its inner fields as being part of the parent.
    // This is useful to remove some depth in multi-nested-object.
    // The name of this field remains, but it shows no editor.
    [Inspect, DisplayAsParent]
    public SubObject myObject = new SubObject();

    [AdvancedInspector]
    public class SubObject
    {
        [Inspect]
        public float myField;
    }
}