CHAPTER 2

Programming C# in Unity

This chapter covers the basics of programming C# in Unity. In each section, you’ll create a small Unity project. Those projects explore some C# programming features as well as how to use them in Unity. This book focuses on those portions of C# necessary for coding games in Unity. C# as a whole is a much larger language. You’ll be just fine learning a smaller subset and sticking with it as you work through the rest of this book. In the more distant future, when you become more experienced as a game developer, you may wish to learn more advanced C# techniques.

The Default C# Script in Unity

  • <Step 1> Create a 2D project in Unity and use “DataTypes” as the name.

    You can use the Unity Hub to do this. In the hub ...

Get 2D Game Development with Unity 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.