Tasharen Entertainment Forum

Support => NGUI 3 Support => Topic started by: beyonddoor on May 03, 2016, 08:16:48 AM

Title: The best way to hide/show UIWidget?
Post by: beyonddoor on May 03, 2016, 08:16:48 AM
UIPanel.LateUpdate is invoked too often in my game, I found hide an UIWidget by GameObject.SetActive(false) will force the UIPanel to rebuild itself, So I have the following methods:
The method 2 and method 3 works as expected, both make UpdateGeometry called less often, but I want to know the best way to hide and show UIWidget (and widgets in its children), any advise is appreciated, thanks
Title: Re: The best way to hide/show UIWidget?
Post by: ArenMook on May 03, 2016, 02:10:58 PM
Scale of 0 is invalid. You can't divide by zero.

If you want to avoid updates, SetActive(false) on the panel is the way to go. Don't bother with individual widgets. Enable/disable the panel they belong to instead.