custom editor EditorGUILayout.ObjectField only shows the assets folder

When i click the field to select the object it only shows the assets folder objects . Is there any way to show the scenes tab ?

EditorGUILayout.ObjectField takes a parameter to specify which type of object to select.

In Unity 2.6.1 you can use ...

  • typeof(UnityEngine.Object) -- only shows assets in the selection menu, but you can drag/drop game objects from the scene
  • typeof(GameObject) -- selection menu lets you choose from all your game objects in the scene (and no longer get to choose from assets)
  • typeof(BuiltInComponent) -- lets you select from all components of this type in the scene
  • typeof(ScriptedComponent) -- gives you a large number of objects to choose from, but only accepts ones that have your custom component attached (seems like there's a minor bug)

In Unity 3.1, the selector is much nicer -- a tabbed dialog with preview instead of a huge long menu -- BUT it always restricts the view to assets. The fact that it's tabbed makes it look like it should should support other groups of objects, but it's not there yet. Not sure if this is a bug or a missing feature. I added a feature request here, vote for it if you want it fixed.