Search Unity

EditorGUI.ObjectField like behavior for non-asset ScriptableObjects?

Discussion in 'Scripting' started by greg-h, Sep 27, 2013.

  1. greg-h

    greg-h

    Joined:
    Jul 29, 2012
    Posts:
    17
    Hi there everybody,

    I'm putting together an editor utility, and I've run into a bit of a problem.

    Basically....I have a set of classes using serialized ScriptableObjects to reference each other. The references can be set in a custom EditorWindow. Sometimes those references won't be to the ScriptableObjects, but rather to scene GameObjects/Components or any other UnityEngine.Object.

    I would really like to use the EditorGUI.ObjectField to allow the user to assign those references, but it appears to be limited to including only assets and scene objects.

    Is there any way to populate a custom list of UnityEngine.Objects and present that list through the ObjectField or something similar?

    Because that would be awesome.

    Otherwise, I guess I'll make a custom window to emulate the existing functionality + the new requirements.

    Thanks for your time.