Support => NGUI 3 Support => Topic started by: Simie on November 24, 2013, 05:58:45 PM
Title: Disabled UIAnchor updates when window is resized
Post by: Simie on November 24, 2013, 05:58:45 PM
NGUI 3.0.6 rc3
A disabled UIAnchor will Update() when the window is resized. Bug?
Title: Re: Disabled UIAnchor updates when window is resized
Post by: ArenMook on November 24, 2013, 06:26:15 PM
It's intentional. Anchors now disable themselves when "run only once" option is turned on instead of getting destroyed. They also listen to screen size changes, even when disabled.
Title: Re: Disabled UIAnchor updates when window is resized
Post by: Simie on November 24, 2013, 06:36:55 PM
I didn't have the "one only once" option enabled on those UIAnchors, though.
I also can't see any logic in UIAnchor.cs which would cause the documented behaviour, either. Looks like it would update whenever the screen is resized, regardless of the runOnlyOnce flag.
Title: Re: Disabled UIAnchor updates when window is resized
Post by: ArenMook on November 24, 2013, 06:59:11 PM
It happens because of UICamera.onScreenResize += Update; subscription.
Title: Re: Disabled UIAnchor updates when window is resized
Post by: ArenMook on November 24, 2013, 07:01:06 PM
Title: Re: Disabled UIAnchor updates when window is resized
Post by: Simie on November 24, 2013, 07:03:58 PM
Oh right, I thought the intended behaviour was to only respond to screen size changes when runOnlyOnce was true, not that it would always respond to screen size changes no matter what. It makes sense now, thanks.