Book Image

Learning C# by Developing Games with Unity 2021 - Sixth Edition

By : Harrison Ferrone
Book Image

Learning C# by Developing Games with Unity 2021 - Sixth Edition

By: Harrison Ferrone

Overview of this book

The Learning C# by Developing Games with Unity series has established itself as a popular choice for getting up to speed with C#, a powerful and versatile programming language with a wide array of applications in various domains. This bestselling franchise presents a clear path for learning C# programming from the ground up through the world of Unity game development. This sixth edition has been updated to introduce modern C# features with Unity 2021. A new chapter has also been added that covers reading and writing binary data from files, which will help you become proficient in handling errors and asynchronous operations. The book acquaints you with the core concepts of programming in C#, including variables, classes, and object-oriented programming. You will explore the fundamentals of Unity game development, including game design, lighting basics, player movement, camera controls, and collisions. You will write C# scripts for simple game mechanics, perform procedural programming, and add complexity to your games by introducing smart enemies and damage-causing projectiles. By the end of the book, you will have developed the skills to become proficient in C# programming and built a playable game prototype with the Unity game engine.
Table of Contents (18 chapters)
15
Pop Quiz Answers
16
Other Books You May Enjoy
17
Index

To get the most out of this book

The only thing you need to get the most from your upcoming C# and Unity adventure is a curious mind and a willingness to learn. Having said that, doing all the code exercises, Hero's trials, and Quiz sections is a must if you hope to cement the knowledge you're learning. Lastly, revisiting topics and entire chapters to refresh or solidify your understanding before moving on is always a good idea. There is no sense in building a house on an unstable foundation.

You'll also need a current version of Unity installed on your computer — 2021 or later is recommended. All code examples have been tested with Unity 2021.1 and should work with future versions without issues.

Software/hardware covered in the book

Unity 2021.1 or later

Visual Studio 2019 or later

C# 8.0 or later

Before starting, check that your computer setup meets the Unity system requirements at https://docs.unity3d.com/2021.1/Documentation/Manual/system-requirements.html.

Download the example code files

The code bundle for the book is hosted on GitHub at https://github.com/PacktPublishing/Learning-C-by-Developing-Games-with-Unity-Sixth-Edition. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Download the color images

We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: https://static.packt-cdn.com/downloads/9781801813945_ColorImages.pdf.

Conventions used

There are a number of text conventions used throughout this book.

CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. For example; "Select the Materials folder."

A block of code is set as follows:

public string firstName = "Harrison";

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are highlighted:

accessModifier returnType UniqueName(parameterType parameterName) 
{
    method body
}

Bold: Indicates a new term, an important word, or words that you see on the screen, for example, in menus or dialog boxes. For example: "Click on Create | 3D Object | Capsule from the Hierarchy panel."