Search Unity

Request: Buttons for selecting parent prefab and base parent prefab

Discussion in 'Prefabs' started by joshcamas, Jan 18, 2019.

  1. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    1,277
    One cool feature that would be pretty rad are a few buttons on this interface:


    Specifically, a button that lets me select the prefab's parent, or base parent.
    It would be even RADDER if it showed it's full parent tree (all direct parents) but that's just a fun addition.

    This would be very nice, since it is much faster than clicking "Open Prefab", waiting for prefab to open, then "Select" parent. :))

    Thank you!

    OR OR OR If this doesn't exist - is it possible to extend this interface? That would be very rad, cause then we could add our own features :)
     
    JesOb and Lurking-Ninja like this.
  2. runevision

    runevision

    Joined:
    Nov 28, 2007
    Posts:
    1,892
    Double-click the base object shown in the picture you attached. That takes you to the base.

    This is how all object fields work. Double-click to select the object in the field.
     
  3. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    924
    Hi there!

    Yet, is there any chance this 1-button panel is going to be exposed to be customised in the future?
    Most of the time the Inspector has plenty of space available, would be really nice if it could be accessed to develop prefab specific tools.

    It's just because... it kind of feels weird having a single unique button sitting there all alone.

    Maybe it's just a temporary solution to allow users to get accustomed to the new system, so it's likely going to disappear in 2019.x?
     
    joshcamas likes this.
  4. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    1,277
    Looking at the source code, it may be possible to rig a custom inspector. This would be done by creating a custom editor for the GameObject type, and then detecting if it's a prefab. If so, do extra stuff, if not, render normally.

    I'll look into this.
     
    NeatWolf likes this.
  5. joshcamas

    joshcamas

    Joined:
    Jun 16, 2017
    Posts:
    1,277
    Alright, so it looks a bit more complex than I initially thought. Prefabs are considered external assets, so an editor needs to be a asset

    However, it can be done apparently! Here is someone who made a script that actually makes prefabs editable without entering prefab mode, using some fancy reflection. (Since prefab editors are internal, classic unity) However, I personally cannot get this working for some reason. If I ever do get it working, it'd be cool to make a little addition that allows for custom editors to hook onto it :)
     
    Last edited: Jan 21, 2019
    NeatWolf likes this.