For complex objects and editor interactions, you may find the number of GUI statements gets high, and code can quickly get hard to manage with very long OnGUI() methods. One approach to organise complex GUIs involves a list of items, and each item being an object-instance of a wrapper-class for a GUI control object. Each wrapper class will implement its own OnGUI() method.
In this recipe, we'll use this approach to create a complex GUI with well-organised code. This recipe is adapted from an example posted by Statement on answers.unity.com in 2013 to a question about the different IMGUI libraries: https://answers.unity.com/questions/601131/editorgui-editorguilayout-gui-guilayout-pshhh-when.html
We'll create IMGUI static labels, interactive text boxes and a button, and illustrate some flexible space and...