Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: Wisteso on August 11, 2014, 10:18:14 PM
-
Previously with 3.5.8, my NGUI component was working almost flawlessly. No real hacks in use.
However, upgrading to 3.6.9 has completely glitched the GUI. (Upgrade was done in a blank scene per instructions). Most of my panels are now way out of position in Play Mode, but look fine in Editor Mode before hitting play. Some of the issues I'm having are...
- Some NGUI components (like UI Root) are positioning themselves in the 'World' camera, when they should be inside the 'UI Root' camera
- NGUI itself seems to be contradicting itself with what it shows in the inspector and what it renders. E.G. 'UI Root' inspector shows XYZ=20,20,0 yet gets displayed at XYZ=0,0,0.
- Some elements are just floating around at a location that's parallel to both the 'UI Root' camera and the 'World' camera
It's a mess and I dont see any hint of an idea why this happened in the release notes or documentation. My only idea is that the changes to anchors messed everything up. My GUI uses a ton of anchoring (OnEnable) and a few UIAnchors.
I've attached two screenshots taken from Scene View (since that's where the issue is most obvious). "Play Mode" layers the NGUI camera on top of the World camera, if that's not apparent from the screenshots.
-
If you look in the advanced options on the UIPanels that you're anchoring to, if "Offset" is checked, the position of UIRoot counts. An offset of 20,20 will move your stuff 10 screens away. It works on the global position of the panel. Quick fix is to place UIRoot in 0,0,0.
Also take a look at your layers. NGUI finds its cameras by looking at which layer the widget/camera is in, (FindCameraForLayer), so if you're using default for everything things like this can happen depending on which camera is found first. Move your UI into its own layer (define a new one) and see if the problem persists.