Summary

We first covered how to write a C# statement, especially the semi-colon to terminate a statement. All the Component properties shown in the Inspector panel are member variables in the Component's class. Member variables can be shown in the Inspector panel, or accessed by other scripts when the variable is declared as public. The type of data a variable can store is specified when it's declared. Finally, we learned that variable scope determines where it is allowed to be used.

Now that we've learned about variables, we're ready to learn the details of C# methods that will use the variables we create – which is the topic of the next chapter.

Get Learning C# by Developing Games with Unity 3D Beginner's Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.