I would very much like to package up my individual NGUI UIs into prefabs, and on my first day have been very happy with how easy it is to get going with NGUI.
I did run into an issue though when instantiating prefabs.
I ASSumed that to create the prefab I should be dragging the UI root into an empty prefab, which means that the prefab has a child camera object. This, of course, ensures that NGUI will draw the UI components.
My issue is that when I have more than one prefab (e.g., I have a splash screen NGUI prefab and a network file transfer dialog NGUI prefab) there end up being two NGUI cameras in the scene, and it appears that each camera renders both NGUI prefabs (the cameras don't just draw their child objects.)
Am I just screwing this up conceptually?
Worst case, I could simply ensure that at least one NGUI camera was in the scene and delete any new ones that appear after prefab instantiation (or the reverse, don't include any cameras and instantiate a camera when adding NGUI prefabs if I haven't done so already...)
I also presume that having multiple cameras would make optimizations difficult (render queuing, sorting, atlas usage, et cetera...)
Anybody prefab their dialogs like this? If so, what's your approach?
BTW, NGUI is great, thanks for the hard work.
Cheers,
Hans