I have a custom inspector which requires the user to drop script and texture files into it. In the default inspector, the texture2D fields look just like the script fields (a field with the name of the file in it), but when I add the texture2D field to the custom inspector, it only displays an image box. Is there a way to change this? I checked out the GUILayout options, but didn’t see anything.
Here is the line of code:
Texture2D icon = EditorGUILayout.ObjectField(icon, typeof(Texture2D), true) as Texture2D;
Hey there 

You can change this easily:
// (A)
icon = EditorGUILayout.ObjectField(icon, typeof(Texture2D)) as Texture2D;
// (B)
EditorGUIUtility.LookLikeInspector();
icon = EditorGUILayout.ObjectField(icon, typeof(Texture2D)) as Texture2D;
EditorGUIUtility.LookLikeControls(); // back to normal
If using Unity 4 you can also take advantage of the new EditorGUIUtility.ShowObjectPicker and EditorGUIUtility.GetObjectPickerObject functions to display the object selection window. The benefit with this approach is that you can customize the object field to look exactly as you want. This is similar to the brush selection interface in Rotorz Tile System.
I hope this helps!