Search Unity

  1. Unity 2020.2 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Modify prefabs and add a GameObject to it

Discussion in 'Prefabs' started by unity_bibIFrr_mkm9jw, Nov 19, 2020.

  1. unity_bibIFrr_mkm9jw


    Nov 2, 2020

    Let's assume I have a simple scene used for setup my levels. On this scene I have a canvas containing the UI elements, and my controllers. All elements in this scene are prefabs of course.

    Now, I want to add an UI Text element to my scene (for diamonds for example). I created a serializedField in my controller to populate this field dynamically, and dragged it in the inspector view.

    But, if I'm loading my already created levels, the field is here, but not the reference...
    Is their any ways to do it automatically, or have I to go through my all levels to update this field ?

    I don't know if i'm clear...

    Thank's a lot for your advices.
  2. Xarbrough


    Dec 11, 2014
    Like calling a custom menu item that triggers editor code that opens all scene files and hooks up the references inside and then saves? That's possible. If that is what you need, I can write up some example code.