Now that you’ve learned about the basics of objects, let’s learn about scripts. I should warn you – we’re getting dangerously close to coding our first game.
Scripts are components for our code files. They get our code into the game. We’ve worked with a script already (MyScript) just to get our code running, but we haven’t explored them thoroughly yet.
When it comes down to it, they’re objects. A script is a code file that declares a class. The class acts as a component, allowing us to attach it to GameObjects just as we might attach cameras, lights, colliders, mesh renderers, ...