Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: boudinov on June 06, 2014, 05:15:04 PM
-
Hello,
It seems we have found a very basal bug with anchored UIPanel, containing widgets anchored(OnEnable) to it. It only happens in standalone builds, not inside the editor!
The scenario is this:
Have a UIPanel, with clipping either 'Soft clip' or 'Constrain but don't clip', anchor it to close to the sides of the UIRoot, with anchor execute mode 'OnEnable'.
Add a sprite within it, big enough, anchor it close to the sides of the panel, with anchor execute mode 'OnEnable'.
Add UIToggle mechanism to activate/deactivate the panel.
Add some mechanism to switch resolution.
Build and start the application.
Toggle activate the panel. Toggle deactivate it.
Switch resolution.
Toggle activate panel. Woala, sprite, and probably panel, do not update rect and stay the same size as in the previous resolution. If you disable and enable second time, sprite resizes correctly. If you switch resoltion while panel is activated, all works fine too.
It also work ok if panel is OnEnable, widget is OnUpdate + panel is OnUpdate, widget is whatever.
NGUI version it 3.5.9
Thanks in advance!
-
If I remember correctly, this was already fixed in a later version. You need to update.
-
Just tested it on 3.6.3 and it does not seem fixed.
-
Alright, can you send a repro case for me to look at to support at tasharen.com?
-
Sent an email to support at tasharen.com some days ago. Is that what you meant?
Thanks
-
Yup, I got it, thanks.
-
So, is it a confirmed issue?
-
Yup. Changing the widget to OnUpdate works as expected, and OnEnable does not, which would imply there is some script order execution issue happening. I'm looking into it.
Edit: Looks like it happens because the child gets enabled before the parent -- classic Unity bug. Found a fix for it, you will see it in the next update.