Search Unity

ObjectPicker during Prefab Edit

Discussion in 'Immediate Mode GUI (IMGUI)' started by brownboot67, Dec 22, 2020.

  1. brownboot67

    brownboot67

    Joined:
    Jan 5, 2013
    Posts:
    375
    I have a Custom Inspector and I'm trying use the Object Picker to select one of the child objects inside my prefab, specifically while I am in "Prefab Editing Mode".

    If I have a SerializedProperty for some sort of Object Reference, say a Transform, and I use PropertyField to draw it, the Object Picker picks from within the prefab with no problem.

    BUT, if I roll my own ObjectField or ObjectPicker, no objects of any type show up under the 'self' tab.

    Some secret magic is happening here and I can't figure out how to make it work. Anybody have any ideas?

    Edit: I'm in 2019.4
     
    Last edited: Dec 22, 2020
  2. brownboot67

    brownboot67

    Joined:
    Jan 5, 2013
    Posts:
    375
    Here's a pic that outlines the different cases:

    prefab_mystery.jpg