GUI, Inspector has no control for Arrays?

Well, the default inspector I see has a control for Arrays, when I have "public int myInt;", the inspector knows it is an integer, and when drawing the object inspector, it displays an int-field control to handle that variable.. however, if I was to have an array like Object[] or List, the inspector can determine that it is an array, and draw the appropriate inspector, much like for integers, floats, and enumerators; However..

I cannot for the life of me figure out the control they used to ~inspect~ the arrays; D=

Any in-sight on this? I've actually made my own.. but it doesn't look the same as the built-in one, and I don't want people at all confused, so I am hoping someone has some info on how to use the array inspector that's built in.. thank you!

EditorGUILayout.Foldout is a special toggle control that is the little arrow used in the array (and other group) controls. e.g.

bool expanded = false;

void OnInspectorGUI()
  expanded = EditorGUILayout.Foldout( expanded, "My Array" );
  if( expanded )
    // draw count and elements

If you combine EditorGUILayout.BeginToggleGroup(...) (and, subsequently, EndToggleGroup(...)) and an array of EditorGUILayout.ObjectField(...)'s (or whatever the type of the Array is), you should get the effect you're looking for.

If you want to do this like DrawDefaultInspector(), look at my answer to this question.