IMGUI overview
As I stated earlier, IMGUI gives programmers a quick way to build out UI that can assist them in their development. This is because IMGUI is built exclusively via code. It is not connected to GameObjects, and all objects are rendered via calls to an OnGUI()
or OnInspectorGUI()
method. The OnGUI()
method is called every frame, similar to the Update()
method.
If you want your IMGUI to appear within your scene, you write all your UI building code in an OnGUI()
method within a MonoBehaviour
inheriting script. Because IMGUI items are created via code, any UI you create with it on a MonoBehaviour
script will not render until the game is run.
If you want your UI to appear in an Editor window, you will write all your UI building code in an OnGUI()
method within an EditorWindow
inheriting script. If you want your UI to appear in the Inspector, you write all your UI building code in an OnInspectorGUI()
method within an Editor
inheriting script.
All IMGUI items are created...