I find the Unity way of writing the GUILayout.Button in onGUI to check for button click to contract the way I am used to seeing UI code, in which you instantiate a UI object and set up a click event handler for it. What’s the reasoning behind doing it this way (from a framework creator’s viewpoint)?
function OnGUI {
if (GUILayout.Button("Play")) {
// button clicked
}
}