Hi guys,
We're seeing similar problems to this primarily due to two things:
1. An animation which makes a UI element flicker by turning it on and off. (We can fix this by making it effect colour, but it's unfortunate to need to).
2. Materials being dynamically set by UITextures being populated from the web (such as user's facebook pictures).
The root of the problem as I see it is really that the performance hit/GC alloced gets worse in proportion to the size of your UI, and not in proportion to how one organises stuff. Basically, the way things are now, a full rebuild will always happen every now and then, and if your UI is sufficiently big this will always be slow and expensive. I'm not sure what your plans are for optimising this, but I would like to see you remove the need to refresh the whole UI draw call hierarchy when a single thing disables or enables.
My suggestion (and what I'm probably going to have a stab at doing if I can find the time) is to do one of 2 things:
1. Bin the widgets by panel and rebuild each panel when the dirtying changes occur. This is non-ideal due to the fact that it invalidates a lot of assumptions you've made in NGUI 3 allowing you to aggregate draw calls across panels, however given that we can now control panel depth this appeals to me intuitively.
2. Bin the widgets by panel depth, and dirty the bins when the dirtying events occur. This should preserve behaviour of NGUI completely, while allowing a user to completely isolate frequently changed widgets from the rest of the draw call hierarchy.
I'm not yet sure how feasible this is, but I'll post here if I manage to do it.
Cheers,
Jeremy