My problem is that the EditorGUILayout.ObjectField function opens a window that is missing the “Scene” tab. I can’t search for objects in my hierarchy with an ObjectField.
I’m putting my code in an OnInspectorGUI() function.
public static Transform arrow;
public override void OnInspectorGUI ()
{
EditorGUILayout.BeginHorizontal();
arrow = (Transform)EditorGUILayout.ObjectField("Arrow ",arrow , typeof(Transform));
EditorGUILayout.EndHorizontal();
}
Maybe you need to use EditorGUILayout.PropertyField() along with a SerializedProperty? What are you trying to achieve? (I.e. what do you need different than what the default inspector does?)
I just wanted to completely hide the inspector properties and use the custom editor I coded. I guess I could use the default inspector to do what I want. I’d like to know if the behaviour of EditorGUILayout.ObjectField is normal by not displaying the “Scene” tab, maybe there’s a bug.
We have the same problem. It used to work just fine in Unity 2.6… now that we’ve ported our code it’s only possible to select assets and not objects from the scene.