Linking a prefab to another prefab in deep hierarchy using Inspector

I’m trying to figure out how to have some UI Screen Panels link to one another. I’m considering each screen to be a prefab, and then I’ve created a script that attaches on a button that will connect a screen to another screen. In this way the user will be able to advance through screens.

The problem I’m finding is that when I drag these Panels into the scene, the prefab loses this reference. I’ve taken a screen shot below to indicate an example of the bolded reference (UIButton Flow Panel at the bottom right) that gets lost when the prefab enters the scene.

I suspect there is some issue with linking from deep in the object hierarchy.

I found this rather ancient forum post that suggests that such prefab-to-prefab linking only works at the top level of the hierarchy, not deep like I’ve done here. I’ve tested that and it seems to work. Is that really the only solution?

I want to be clear here. I don’t want prefabs to link to objects in the scene. I know that that doesn’t work. I want to have a prefabs link to other prefabs so that I can organize how they’re connected at the prefab level, and instantiate them or drag them to the scene at some other time.

alt text

" I’m talking about having a child object of one prefab “PopupPanel” have a script that has a reference or link to another prefab “HackPanel.”

Your child object would have a script on it which has something like

var hackPanel : GameObject;

And you can set that via the inspector. It should be like any other variable on any other component: that it will have a default value (null in this case), and instances can override that in the Inspector or with code. You would drag from the Project pane the prefab you want onto this instance’s hackPanel field.

Which looks like what you have done, right? And what’s not working with that?