Back in Chapter 2, The Building Blocks of Programming, we briefly talked about how classes are blueprints for objects, and mentioned that they can be treated as custom variable types. We also learned that the LearningCurvescript is a class, but one that Unity recognizes as being attachable to objects in the scene. The main thing to remember with classes is that they are reference types—when they are assigned or passed to another variable, the original object is referenced, not a new copy. We'll get into this after we talk about structs, but before any of that, we need to understand how to create classes.
Basic syntax
For now, we're going to set aside how classes and scripts work in Unity and bring the focus back to the basics of how they are created, and used, strictly in C#. If you remember the blueprint we roughed out, classes are created using the class keyword, as follows:
accessModifier class UniqueName
{
Variables...