Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: boudinov on June 06, 2014, 05:15:04 PM

Title: Anchoring bug with UIPanel, after switching resolution, outside editor
Post 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!
Title: Re: Anchoring bug with UIPanel, after switching resolution, outside editor
Post by: ArenMook on June 06, 2014, 09:57:21 PM
If I remember correctly, this was already fixed in a later version. You need to update.
Title: Re: Anchoring bug with UIPanel, after switching resolution, outside editor
Post by: boudinov on June 07, 2014, 05:37:55 AM
Just tested it on 3.6.3 and it does not seem fixed.
Title: Re: Anchoring bug with UIPanel, after switching resolution, outside editor
Post by: ArenMook on June 07, 2014, 09:08:16 PM
Alright, can you send a repro case for me to look at to support at tasharen.com?
Title: Re: Anchoring bug with UIPanel, after switching resolution, outside editor
Post by: boudinov on June 11, 2014, 02:13:25 PM
Sent an email to support at tasharen.com some days ago. Is that what you meant?
Thanks
Title: Re: Anchoring bug with UIPanel, after switching resolution, outside editor
Post by: ArenMook on June 12, 2014, 02:19:41 AM
Yup, I got it, thanks.
Title: Re: Anchoring bug with UIPanel, after switching resolution, outside editor
Post by: boudinov on June 13, 2014, 03:36:28 AM
So, is it a confirmed issue?
Title: Re: Anchoring bug with UIPanel, after switching resolution, outside editor
Post by: ArenMook on June 13, 2014, 05:25:49 AM
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.