Often have I read on several threads on this forum or on other websites that the OnGUI function was to be forgotten (as much as possible) when it comes to mobile applications.
Even though there are many voices on this forum I consider very trustful, I decided to run some tests, to measure and quantify the impact it has.
So I built a GUI using OnGUI functions (GUILayout, BeginArea, BeginGroup, DrawTexture, etc.) and I did the same interface using GUITexture. The result is… nothing : the number of draw calls is exactly the same between the two versions… I did the same with a GUITexture and a GUIText versus a GUI.Label and a GUI.DrawTexture.
What does it mean ?
A- I’m a master of the OnGUI function and I know how to optimise it like no one else does (I seriously doubt that)
B- I don’t know anything about how to use GUITexture and I’m so bad even the OnGUI function is not worse (I kind of doubt that too)
C- A little bit of both (Not much better of a solution)
So I would go with :
D- Something else I would really appreciate to get explanations about and possibly examples of a “real” optimisation and performance gain between the two solutions.
Thanks a lot.