Search Unity

Exposing specific properties to parent prefabs

Discussion in 'Prefabs' started by Grumpy-Dot, Jun 20, 2018.

  1. Grumpy-Dot

    Grumpy-Dot

    Joined:
    Feb 29, 2016
    Posts:
    93
    Does Unity also plans to add the feature of exposing some child prefabs properties to the parent prefab like there was in the first nested prefab demo? I can't find the original video, maybe can you help me on that.
    Basically you were able to select which properties from the base and from the children you wanted to expose to the base prefab, therefore to make it easier for artists and game designers to play around with only a restricted number of parameters.
    Of course, one obvious solution would be to write your own editor scripts and pass the properties to the children, but this is not as good as having a native integrated solution.
    Let me know Unity dev team still has this into the roadmap.

    Thanks for this awesome feature!
     
    cirocontinisio likes this.
  2. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    842
    It's in the FAQ:
    Can we get the ability to treat Prefabs as “black boxes” where specific properties can be set as exposed and only those can be edited at all on Prefab instances?
    This is something we’d like to explore for a future release. There are some non-trivial challenges involved, such as how to show individual properties in isolation when many properties currently rely on custom editors to be shown correctly.
     
    interpol_kun and Grumpy-Dot like this.
  3. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    While watching the demo from Unite, I was really wondering about this too. In the demo, he made a prefab variant for the plant and he had to swap the same mesh reference from each LOD but also from collider. If this system had "Prefab Addressable", it would let people to assign a prefab property to all the fields referencing the same asset in the variant with a single drag and drop. Think of this only prefab scope addressable (instead of project wide addressable introduced on new addressables package).

    Alternatively, I can think of one hacky workaround that could still help people on doing something similar and would be way easier to implement from Unity side: Once you change any variants property ref, system could quickly iterate through the variant hierarchy to check for other items with same ref and ask if user wants to replace those with the new asset ref as well. It would solve the mesh swapping issues as current approach seems really tedious (especially if you have lots of LODs).
     
    Last edited: Jun 20, 2018
    cirocontinisio likes this.
  4. cirocontinisio

    cirocontinisio

    Joined:
    Jun 20, 2016
    Posts:
    884
    That's me :)

    That would be a cool thing, not sure what technical implications but mostly UX requirements it would have for more complex scenarios. As an alternative, you can write a quick Editor script for your custom hierarchy that allows you to feed values into properties at the press of a button.

    Maybe I'll create something like this as a proof of concept :)
     
    Grumpy-Dot likes this.
  5. Stardog

    Stardog

    Joined:
    Jun 28, 2010
    Posts:
    1,913
    Maybe I'm not visualising your problem properly, but this seems like a bigger issue with Unity in general, rather than prefab specific. If all fields in Unity could take a reference type instead of just a value, you would be able to click-drag in some new Type called MeshScriptableObject, then change it from the SO, and it would propagate to everything referencing that.