Author Topic: Enable / Disable panel performance hit  (Read 2280 times)

nameles01

  • Guest
Enable / Disable panel performance hit
« on: October 07, 2013, 05:48:56 AM »
Hello Aren,

We've been attempting to optimize NGUI for our games and have gotten fairly smooth performance in our Unity->Flash games but we do still experience a stutter when we enable a UIPanel and it goes through it's first LateUpdate after enabling.

I've been playing with the source and noticed that on disabling a panel gameObject & its nested UIWidgets  pretty much everything is discarded completely ( draw calls, cached transforms, panel references, etc. ). This effectively prevents us from preloading panels and then simply "hiding" them by disabling them and enabling them when we need them.

I've been able to hack that nothing is discarded and only the UIDrawCall mesh renderers are disabled when the UIPanel + children are disabled, but found that panels of which the contents changed while disabled took equal or even longer on their first LateUpdate than those who did not have my "optimization".

I've a few questions about this;
Am I simply doing this wrong; is there a proper way to do this?
Is this a possible feature in the future?

Thanks!
Leon

PS: Have done this in 2.6.3
« Last Edit: October 07, 2013, 06:05:26 AM by nameles01 »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Enable / Disable panel performance hit
« Reply #1 on: October 08, 2013, 02:24:25 AM »
First off, you need to update your NGUI to 2.7.0 at least, if not to 3.0.2. Second, if disabling/enabling panels is too expensive for you for some reason, then just move them off-screen instead.