EditorGUILayout.ObjectField for Array not working...

Hi... I am trying to use EditorGUILayout.ObjectField() function on the array of source objects and it doesn't work although it does work on each object..

Working Version

 void OnGUI()
    {
    GUILayout.BeginVertical();
    GUILayout.Label("Source Object: 	");
    source = EditorGUILayout.ObjectField(source, typeof(Transform)) as Transform;
    }

Non-Working Version

void OnGUI() {

//Create the GameObject type for each Max ObjectTypes     
objectTypes = new Transform[totalMaxObjects.Count];

for (int i = 0; i < totalMaxObjects.Count; i++)
        {
            GUILayout.BeginHorizontal();
            GUILayout.Label(totalMaxObjects*.ID + " : ");*
 <em>objectTypes _= EditorGUILayout.ObjectField(objectTypes*, typeof(Transform)) as Transform;*_</em>
 <em>_*GUILayout.EndHorizontal();*_</em>
 <em>_*}*_</em>
<em>_*}*_</em>
<em>_*```*_</em>
<em>_*<p>The Nonworking version doesn't give me an error although it doesn't allow me to drag drop my objects from the Project Hierarchy. </p>*_</em>

Does C# need that whole "typeof(Transform) as Transform"? In unityscript using just "Transform" works. I'd imagine you could at least remove "as Transform", but C# does tend to be ridiculously strict at times.

It's difficult for me to understand what "objectTypes" is supposed to represent, since you're assigning objects to it and not types. I use the ObjectField function myself, though, and it's working for me in the format -

ObjectField( "Label", objectTypes*, Object )

* *

If your "= new Transform[" line is just before the for loop, that's destroying your array before displaying it, and that might be your problem.

*