I started coding my GUI system mostly drawing things in the OnGUI function and I have my own static GUI class that handles a lot of GUI for me, the new UI system seems clunky and the scripting behind it strange to me how it is treated as a gameobject,
I would prefer just to use my original GUI static class I wrote myself, is there any reason I should use the new GUI over the old GUI.Draw functions Ive been using such as performance?
Here are a few reasons to upgrade
- Performance. UI elements do not need any methods called each frame, in fact nothing gets called unless the element receives an event
- Art and style. You have full access to the entire 2D set of tools to draw your UI
- Visual editing. Its nice to be able to see graphics as you build them. No more grabbing out a pen and paper to calculate where your rects should go
- Using regular components and monobehaviours. Your UI elements are GameObjects defined by the components you attach. This means you can implement any custom control behaviour you want
The key to adjusting is simply to remember that the new UI is just GameObjects with components attached. It behaves exactly as the rest of Unity does. Its not a case of learning the new UI, its a case of unlearning OnGUI.
There are some good tutorials linked in my signature. (Okay, Iām slightly biased).
1 Like