16
NGUI 3 Support / UIScrollView optimization
« on: February 18, 2014, 05:02:55 PM »
I have a use case where UIScrollView.LateUpdate is taking about 20ms to run on an iPad 2. Part of the problem is that I have way too many widgets in the scroll view, but the other part is that one of its children has a pulsing color, causing UIScrollView to recalculate the bounds of its children every frame. It's deciding whether to change the alpha on the scroll bars, but there are no scroll bars. I've locally changed this line near the top of LateUpdate:
if (showScrollBars != ShowCondition.Always)
to this:
if (showScrollBars != ShowCondition.Always && (verticalScrollBar || horizontalScrollBar))
I can also change showScrollBars to Always on my prefab, but that's too easy.
if (showScrollBars != ShowCondition.Always)
to this:
if (showScrollBars != ShowCondition.Always && (verticalScrollBar || horizontalScrollBar))
I can also change showScrollBars to Always on my prefab, but that's too easy.