I was wondering what is the proper way to display UI elements like text panels with buttons and all that. I knew only about the UI elements which you can get from the editor.
recently I found out about onGUI and that you set text and buttons from the script.
Can you explain to me the difference between them. Thanks.
OnGUI() is the old system. UI was introduced in Unity 4.6 (I think) to replace OnGUI and should be used for all new development.
you need to know, that new UI system is old GUI based. We can compare it with a good asset pack, which make our developing easier. Actually new UI is modified and upgraded version of popular asset uGUI.