Hello,
We recently did first to flash conversion and found a few areas we'd like to improve on.
In Unity total UI cost is around 3%. In flash it's just above 30%. Any help is much appreciated.
We are on NGUI 2.1.0.
We already know that vast majority of the cost of UI in Unity is in UIPanel.UpdateWidgets(). Vast majority of that is in node.HasChanged() (in UpdateTransforms). In flash the two loops foreach (KeyValuePair<Transform, UINode> c in mChildren) in UpdateWidgets() and in UpdateTransforms() seems to be quite expensive as well.
In flash it seems cost of HasChanged() is multiplied by at least 10x.
FYI we have close to 350 nodes in our UI.
It seems optimizing HasChanged() in Flash is an easy win. For whatever reason just in Flash the transform gets and compares (both vector and quaternions) are much more expensive then in Unity. Does anyone know why that happens? Is there something flash is faster at comparing?
Lower priority is to try make the foreach loops run faster (or maybe not use foreach?) Is foreach in this case faster then just a for loop? (#if UNITY_FLASH implies that it is).
Thank you.
Cheers.