By using a little Unity magic, a script becomes a Component
While working in Unity, we wear the following two hats:
A Game-Creator hat
A Scripting (programmer) hat
When we first wear our Game-Creator hat, we will be developing our Scene, selecting GameObjects, and viewing Components; just about anything except writing our scripts.
When we put our Scripting hat on, our terminology changes as follows:
We're writing code in scripts using MonoDevelop
We're working with variables and methods
The magic happens when you put your Game-Creator hat back on and attach your script to a GameObject. Wave the magic wand — ZAP — the script file is now called a Component, and the public variables of the script are now the properties you can see and change in the Inspector panel.
A more technical look at the magic
A script is like a blueprint or a written description. In other words, it's just a single file in a folder on our hard drive. We can see it right there in the Projects panel. It can't do anything just sitting...