Monobehaviours overriden functions (OnGUI, Update, Start, those sorts of things) are executed for each objects they are attached to. So if you want Unity to call them, you HAVE to attach your script to an object. It can be an empty on, with just the transform component, as long as it is in the scene.