Sorry, I should have explained in a little more detail, I will remember that for the future.
So, when you create a script in Unity it creates a little bit of code for you from a template, just the basics to allow it to run, but not really do anything within your game.
You’ll notice at the top of the code there is a class definition, e.g. public class Smurf for example.
The access modifier is there as mentioned earlier, and you could think of a class as being a template for the creation of objects, we would call these instances, e.g. a specific instance of our class
Properties and behaviours can be added to this class so that they can be used by the instance or other code which uses it.
For example, if I had a class called Square it may have a couple of fields (class variables) which hold width and height values for that square.
It may have a behaviour (method) which calculates and returns the area of that instance of Square, using the width and height fields.
I could potentially use this same Square class to create many different Square instances, all of which may have differing widths and heights.
Every object will have a type, e.g.
string message = "Hello World!";
Message is your variable and it’s a String, so we would say “message is of type String”
int robsAge = 41;
robsAge is the variable and it’s an integer (whole number), we would say “robsAge is of type Int” (and blimey, he’s old!
)
So with your own classes your are creating your own types… in the above example, smurf would be the type. In the shape example, square would be the type.
I hope the above is useful, do say if you have any other questions and thanks for the feedback on the initial reply, I will bear it in mind for future replies 