Was just profiling my game on iOS 4 trying to do some serious optimizations and I noticed after playing for awhile the frame rate was dropping considerably.
In the unity profiler UIPanel.LateUpdate peeks at 123.43ms at one instance! And seems to spike every 30 or so frames.
I have 3 panels in my scene, 1 for GUI, 1 to render particles and fx to and 1 for tiled animated sprite as a background.
I noticed my GUI panel starts off with 20 widgets in it, and as soon as an animation plays that number goes up to 45. During gameplay my HUD only consists of 15 visible widgets, but the panel still claims 45.
The panel i'm using to render FX never really goes over 10-15 widgets, but could theoretically go as high as 40-50.
When profiling It doesn't seem to be either the FX or Backgroun panels which are costing, but the GUI panel.
I saw a post regarding "offscreen UIPanel Lateupdate" and "disable when finished" option of UIButtonPLayAnimation... i have a few UI animations playing independently from NGUI's messaging (due to an incompatibility with Unity's animation event system) and am wondering if there's a cost with not calling "disable when finished"? I mean the widgets are disabled at the object level when not being used, that should be enough, right?
Is there something else that could explain the crazy high ms cost?
-EDIT-
Also, if not using UIAnchor on any active widgets, is there any reason why it would need to be called every frame? and costing upwards of 50ms on some spikes? The only ones in my scene are located on the parent object above the panel.