I’d like to fold out the base class items in the inspector with the code below.
I want a child class inspector to show a “common” foldout for the base class items followed by the items unique to the child class - how do I do that?
using UnityEngine;
using UnityEditor;
using System.Collections;
[CustomEditor (typeof(ServerObject))]
public class ServerObjectCustomInspector : Editor
{
bool folded;
public override void OnInspectorGUI()
{
folded = EditorGUILayout.Foldout(folded, "Common");
if (folded)
DrawDefaultInspector ();
if (GUI.changed)
EditorUtility.SetDirty (target);
}
}