I don't know what happened, but now the pink Plane defining my UI Root and my white special cube representing the Camera's view are not aligned, and I can no longer see my widgets in my game.
Background information, if it helps:
- I'm using a constrained scaling style, 800 x 480 with the Fit option for both content width and content height.
- I made my "UI Root" as a prefab, and create it at runtime
- I have a scene, UIDevelopment, where I want to develop my UI screens and interface. So I work on "UI Root"s children in this scene, and then save the prefab, and test it out in my game scene.
- I didn't notice any misalignment issues until after doing NGUI -> Create -> 3D UI, and it created a "UI Root (3D)" object. I've since deleted it though, since I couldn't figure out how to make 3d UI.
Questions for my understanding:
1. What's the relationship between UI Root->Camera and the scene's MainCamera? Are they the same? Are they supposed to have identical position/orientation at all times, or just that the UI Root->Camera output is displayed on top of the MainCamera output?
2. How can I align the UI Root's panel or the 2D pink rectangle with the UI Root's Camera? The pink rectangle is nowhere inside the white orthographic projection of the camera, and I don't know how to get it inside there, or how it ever got out of there..
3. Why does my UI Root have an odd scaling? The x/y/z scaling is 0.004166667. Is this small number something out of the ordinary?
4. Finally, if I have a child GameObject underneath UI root, and modify its x/y/z position, it does absolutely nothing? Shouldn't I be able to modify x and y to move child containers, sprites, labels, etc around?
Example of my setup:
Main Camera
UI Root (UIRoot, UIPanel, Rigidbody, UIEvent Trigger)
Camera (Camera, UICamera)
DefaultUI (DefaultUI)
Button_Gold
Container (UIWidget, Box Collider, UIButton)
Sprite (UISprite)
Label (UILabel)
With this setup, modifying the position of Button_Gold does absolutely nothing to any children below it. Is this by design? I am using GameObjects as a grouping mechanism, to organize UI screens in my game and hide/show them as appropriate.