Preamble: I have a fix for this problem but I wanted to make a post about it to find out more about how NGUI works and to provide a solution in case anyone else ever comes across this same issue.
I found a weird problem when running our game on old slow iPhones (3GS and 4). In situations where we activate an UIPanel and then perform a legacy animation on it, we arrive at a situation where the widgets on the panel aren't visible, but when you click on the space where they should be, they blink into existence. It is like they are actually there, but they have not been drawn. If you zoom out however, you can see that the widgets are actually remaining in their original, pre-animation positions. Very odd. Since we didn't see the animation play, we suspect what is happening is that the activation of the Panel and all its widgets is taking so long that the animation is actually completed before the widgets were active. Somehow after this the widgets are in some weird state that I don't fully understand.
I thought I'd be able to fix this by forcing a UIPanel.Refresh(), but that didn't work. I was able to fix it however with this following code:
foreach(var w in m_uiPanel.widgets){
w.MarkAsChanged();
}
m_uiPanel.Refresh();
In this
thread you mentioned that
Panel's Refresh() will refresh the draw calls, but only of the widgets that have been registered with the panel. MarkAsChanged registers the widget with the panel.
Are the widgets being unregistered somehow? Or is it that some other code that is supposed to mark widgets as changed never runs in this case? I'm not really sure why I have to manually mark all the widgets as changed.