Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Learning C# by Developing Games with Unity 2020
Learning C# by Developing Games with Unity 2020

Learning C# by Developing Games with Unity 2020: An enjoyable and intuitive approach to getting started with C# programming and Unity , Fifth Edition

eBook
€8.99 €32.99
Paperback
€41.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Learning C# by Developing Games with Unity 2020

The Building Blocks of Programming

Any programming language starts off looking like ancient Greek to the unaccustomed eye, and C# is no exception. The good news is that underneath the initial mystery, all programming languages are made up of the same essential building blocks. Variables, methods, and classes (or objects) make up the DNA of conventional programming; understanding these simple concepts opens up an entire world of diverse and complex applications. After all, there are only four different DNA nucleobases in every person on earth; yet, here we are, unique organisms to the last.

If you're new to programming, there's going to be a lot of information coming at you in this chapter, and this could mark the first lines of code that you've ever written. The point is not to overload your brain with facts and figures; it's to give you a holistic look at the building blocks of programming using examples from everyday life.

This chapter is all about the high-level view of the bits and pieces that make up a program. Getting the hang of how things work before getting into the code directly will not only help you new coders find your feet, it will also solidify the topics with easy-to-remember references. Ramblings aside, we'll focus on the following topics throughout this chapter:

  • Defining what variables are and how to use them
  • Understanding the purpose of methods
  • Classes and their role as objects
  • Turning C# scripts into Unity components
  • Component communication and dot notation

Defining variables

Let's start with a simple question: what is a variable? Depending on your point of view, there are a few different ways of answering that question:

  • Conceptually, a variable is the most basic unit of programming, as an atom is to the physical world (excepting string theory). Everything starts with variables, and programs can't exist without them.
  • Technically, a variable is a tiny section of your computer's memory that holds an assigned value. Every variable keeps track of where its information is stored (this is called a memory address), its value, and its type (for instance, numbers, words, or lists). 
  • Practically, a variable is a container. You can create new ones at will, fill them with stuff, move them around, change what they're holding, and reference them as needed. They can even be empty and still be useful.

A practical real-life example of a variable is a mailbox; remember those?

They can hold letters, bills, a picture from your aunt Mabel – anything. The point is that what's in a mailbox can vary: they can have names, hold information (physical mail), and their contents can even be changed if you have the right security clearance.

Names are important

Referring to the preceding photo, if I asked you to go over and open the mailbox, the first thing you'd probably ask is: which one? If I said the Smith family mailbox, or the brown mailbox, or the round mailbox, then you'd have the necessary context to open the mailbox I was referencing. Similarly, when you are creating variables, you have to give them unique names that you can reference later. We'll get into the specifics of proper formatting and descriptive naming in Chapter 3, Diving into Variables, Types, and Methods.

Variables act as placeholders

When you create and name a variable, you're creating a placeholder for the value that you want to store. Let's take the following simple math equation as an example:

2 + 9 = 11

Okay, no mystery here, but what if we wanted the number 9 to be its variable? Consider the following code block:

myVariable = 9

Now we can use the variable name, myVariable, as a substitute for 9 anywhere we need it:

2 + myVariable = 11
If you're wondering whether variables have other rules or regulations, they do. We'll get to those in the next chapter, so sit tight.

Even though this example isn't real C# code, it illustrates the power of variables and their use as placeholder references. In the next section you'll start creating variables of your own, so keep on rolling!

Time for action – creating a variable

Alright, enough theory; let's create a real variable in our LearningCurve script:

  1. Double-click on LearningCurve to open it in Visual Studio and add lines 7, 12, and 14 (don't worry about the syntax right now – just make sure your script is the same as the script that is shown in the following screenshot):

  1. Save the file using command + S on a Mac keyboard, or Ctrl + S on a Windows keyboard.

For scripts to run in Unity, they have to be attached to GameObjects in the scene. HeroBorn has a camera and directional light by default, which provides the lighting for the scene, so let's attach LearningCurve to the camera to keep things simple: 

  1. Drag and drop LearningCurve.cs onto the Main Camera.
  2. Select the Main Camera so that it appears in the Inspector panel, and verify that the LearningCurve.cs (Script) component is attached properly.
  1. Click Play and watch for the output in the Console panel:

The Debug.Log() statements printed out the result of the simple math equations we put in between the parentheses. As you can see in the following Console screenshot, the equation that used our variable worked the same as if it was a real number:

We'll get into how Unity converts C# scripts into components at the end of this chapter, but first, let's work on changing the value of one of our variables.

Time for action – changing a variable's value

Since currentAge was declared as a variable on line 7, the value it stores can be changed. The updated value will then trickle down to wherever the variable is used in code; let's see this in action:

  1. Stop the game by clicking the Play button if the scene is still running.
  2. Change Current Age to 18 in the Inspector panel and play the scene again, looking at the new output in the Console panel:

The first output will still be 31, but the second output is now 19 because we changed the value of our variable. 

The goal here wasn't to go over variable syntax but to show how variables act as containers that can be created once and referenced elsewhere. We'll go into more detail in Chapter 3, Diving into Variables, Types, and Methods.

Now that we know how to create variables in C# and assign them values, we're ready to dive into the next important programming building block: methods!

Understanding methods

On their own, variables can't do much more than keep track of their assigned values. While this is vital, they are not very useful on their own in terms of creating meaningful applications. So, how do we go about creating actions and driving behavior in our code? The short answer is by using methods. 

Before we get to what methods are and how to use them, we should clarify a small point of terminology. In the world of programming, you'll commonly see the terms method and function used interchangeably, especially in regards to Unity. Since C# is an object-oriented language (this is something that we'll cover in Chapter 5, Working with Classes and Object-Oriented Programming), we'll be using the term method for the rest of the book to conform to standard C# guidelines.

When you come across the word function in the Scripting Reference or any other documentation, think method. 

Methods drive actions

Similarly to variables, defining programming methods can be tediously long-winded or dangerously brief; here's another three-pronged approach to consider:

  • Conceptually, methods are how work gets done in an application. 
  • Technically, a method is a block of code containing executable statements that run when the method is called by name. Methods can take in arguments (also called parameters), which can be used inside the method's scope.
  • Practically, a method is a container for a set of instructions that run every time it's executed. These containers can also take in variables as inputs, which can only be referenced inside the method itself. 

Taken all together, methods are the bones of any program – they connect everything and almost everything is built off of their structure.

Methods are placeholders too

Let's take an oversimplified example of adding two numbers together to drive the concept home. When writing a script, you're essentially laying down lines of code for the computer to execute in sequential order. The first time you need to add two numbers together, you could just brute-force it like in the following code block:

someNumber + anotherNumber

But then you conclude that these numbers need to be added together somewhere else. Instead of copying and pasting the same line of code, which results in sloppy or "spaghetti" code and should be avoided at all costs, you can create a named method that will take care of this action:

AddNumbers 
{
someNumber + anotherNumber
}

Now AddNumbers is holding a place in memory, just like a variable; however, instead of a value, it holds a block of instructions. Using the name of the method (or calling it) anywhere in a script puts the stored instructions at your fingertips without having to repeat any code. 

If you find yourself writing the same lines of code over and over, you're likely missing a chance to simplify or condense repeated actions into common methods.

This produces what programmers jokingly call spaghetti code because it can get messy. You'll also hear programmers refer to a solution called the Don't Repeat Yourself (DRY) principle, which is a mantra you should keep in mind.

As before, once we've seen a new concept in pseudocode, it's best if we implement it ourselves, which is what we'll do in the next section to drive it home.

Time for action – creating a simple method

Let's open up LearningCurve again and see how a method works in C#. Just like with the variables example, you'll want to copy the code into your script exactly as it appears in the following screenshot. I've deleted the previous example code to make things neater, but you can, of course, keep it in your script for reference: 

  1. Open up LearningCurve in Visual Studio and add in lines 8, 13, and 16 - 19.
  2. Save the file, and then go back and hit Play in Unity to see the new Console output:

You defined your first method on lines 16 to 19 and called it on line 13. Now, wherever AddNumbers() is called, the two variables will be added together and printed to the console, even if their values change:

Go ahead and try out different variable values in the Inspector panel to see this in action! More details on the actual code syntax of what you just wrote are coming up in the next chapter.

With a bird's-eye view of methods under our belts, we're ready to tackle the biggest topic in the programming landscape – classes!

Introducing classes

We've seen how variables store information and how methods perform actions, but our programming toolkit is still somewhat limited. We need a way of creating a sort of super container that has its variables and methods that can be referenced from the container itself. Enter classes:

  • Conceptually, a class holds related information, actions, and behaviors inside a single container. They can even communicate with each other.
  • Technically, classes are data structures. They can contain variables, methods, and other programmatic information, all of which can be referenced when an object of the class is created.
  • Practically, a class is a blueprint. It sets out the rules and regulations for any object (called an instance) created using the class blueprint.

You've probably realized that classes surround us not only in Unity but in the real world as well. Next, we'll take a look at the most common Unity class and how they function in the wild.

A common Unity class

Before you wonder what a class looks like in C#, you should know that you've been working with a class this whole chapter. By default, every script created in Unity is a class, which you can see from the class keyword on line 5:

public class LearningCurve: MonoBehavior

MonoBehavior just means that this class can be attached to a GameObject in the Unity scene. In C#, classes can exist on their own, which we'll see when we create standalone classes in Chapter 5, Working with Classes and Object-Oriented Programming.

The terms script and class are sometimes used interchangeably in Unity resources. For consistency, I'll be referring to C# files as scripts if they're attached to GameObjects and as classes if they are standalone. 

Classes are blueprints

For our last example, let's think about a local post office. It's a separate, self-contained environment that has properties, such as a physical address (a variable), and the ability to execute actions, such as sending in your secret decoder ring voucher (methods). 

This makes a post office a great example of a potential class that we can outline in the following block of pseudocode:

PostOffice
{
// Variables
Address = "1234 Letter Opener Dr."

// Methods
DeliverMail()
SendMail()
}

The main takeaway here is that when information and behaviors follow a predefined blueprint, complex actions and inter-class communication becomes possible.

For instance, if we had another class that wanted to send a letter through our PostOffice class, it wouldn't have to wonder where to go to fire this action. It could simply call the SendMail function from the PostOffice class, as follows:

PostOffice.SendMail()

Alternatively, you could use it to look up the address of the Post Office so you know where to post your letters:

PostOffice.Address
If you're wondering about the use of periods (called dot notation) between words, we'll be diving into that at the end of the chapter – hold tight.

Your basic programming toolkit is now complete (well, the theory drawer, at least). We'll spend the rest of this section taking you deeper into the syntax and practical uses of variables, methods, and classes.

Working with comments

You might have noticed that LearningCurve has two odd lines of gray text (10 and 21 in the last screenshots) starting with two backslashes, which were created by default with the script. These are code comments, a very powerful, if simple, tool for programmers. 

In C#, there are a few ways that you can use to create comments, and Visual Studio (and other code editing applications) will often make it even easier with built-in shortcuts. 

Some professionals wouldn't call commenting an essential building block of programming, but I'll have to respectfully disagree. Correctly commenting out your code with meaningful information is one of the most fundamental habits a new programmer should have. 

Practical backslashes

The single-line comment is exactly what's already in LearningCurve

// This is a single-line comment

Visual Studio doesn't see lines starting with two backslashes (without empty space) as code, so you can use them as much as needed.

Multi-line comments

Since it's in the name, you'd be right to assume that single-line comments only apply to one line of code. If you want multi-line comments, you'll need to use a backslash and an asterisk as opening and closing characters around the comment text:

/* this is a 
multi-line comment */
You can also comment and uncomment blocks of code by highlighting them and using the command + ? shortcut on macOS and Ctrl + K + C on Windows.

Seeing example comments is good, but putting them in your code is always better. It's never too early to start commenting!

Time for action – adding comments

Visual Studio also provides a handy auto-generated commenting feature; type in three backslashes on the line preceding any line of code (variables, methods, classes, and more) and a summary comment block will appear. Open up LearningCurve and add in three backslashes above the ComputeAge() method:

You should see a three-line comment with a description of the method generated by Visual Studio from the method's name, sandwiched between two <summary> tags. You can, of course, change the text, or add new lines by hitting Enter just as you would in a text document; just make sure not to touch the tags.

The useful part about these detailed comments is clear when you want to know something about a method you've written. If you've used a triple forward-slash comment, all you need to do is hover over the method name anywhere it's called and Visual Studio will pop your summary:

We still need to understand how everything we've learned in this chapter applies in the Unity game engine, which is what we'll be focusing on in the next section!

Putting the building blocks together

With the building blocks squared away, it's time to do a little Unity-specific housekeeping before wrapping up this chapter. Specifically, we need to know more about how Unity handles C# scripts attached to GameObjects. For this example, we'll keep using our LearningCurve script and Main Camera GameObject.

Scripts become components

All GameObject components are scripts, whether you or the good people at Unity wrote them. Unity-specific components such as Transform, and their respective scripts, just aren't supposed to be edited by us.

The moment a script that you have created is dropped onto a GameObject, it becomes another component of that object, which is why it appears in the Inspector panel. To Unity, it walks, talks, and acts like any other component, complete with public variables underneath the component that can be changed at any time. Even though we aren't supposed to edit the components provided by Unity, we can still access their properties and methods, making them powerful development tools.

Unity also makes some automatic readability adjustments when a script becomes a component. You might have noticed that when we added LearningCurve to Main Camera, Unity displayed it as Learning Curve, with currentAge changing to Current Age

Part of a previous Time for action section already had you update a variable in the Inspector panel, but it's important to touch on how this works in more detail. There are two situations in which you can modify a property value:

  • In Play mode
  • In development mode

Changes made in Play mode take effect immediately in real-time, which is great for testing and fine-tuning gameplay. However, it's important to note that any changes made while in Play mode will be lost when you stop the game and return to development mode. 

When you're in development mode, any changes that you make to the variables will be saved by Unity. This means that if you were to quit Unity and then restart it, the changes would be retained.

The changes that you make to values in the Inspector panel do not modify your script, but they will override any values you had assigned in your script when in Play mode.

If you need to undo any changes made in the Inspector panel, you can reset the script to its default (sometimes called initial) values. Click on the three vertical dots icon to the right of any component, and then select Resetas shown in the following screenshot:

This should give you some peace of mind – if your variables get out of hand, there's always the hard reset. 

A helping hand from MonoBehavior

Since C# scripts are classes, how does Unity know to make some scripts components and not others? The short answer is that LearningCurve (and any script created in Unity) inherits from MonoBehavior (another class). This tells Unity that the C# class can be transformed into a component.

The topic of class inheritance is a bit advanced for this point of your programming journey; think of it as the MonoBehaviour class lending a few of its variables and methods to LearningCurveChapter 5, Working with Classes, Struct, and OOP, will cover class inheritance in practical detail.

The Start() and Update() methods that we've used belong to MonoBehavior, which Unity runs automatically on any script attached to a GameObject. The Start() method runs once when the scene starts playing, while the Update() method runs once per frame (depending on the frame rate of your machine). 

Now that you're familiarity with Unity's documentation has gotten a nice bump, I've put together a short optional challenge for you to tackle!

Hero's trial – MonoBehavior in the Scripting API

Now it's time for you to get comfortable using the Unity documentation on your own, and what better way than to look up some of the common MonoBehavior methods:

  • Try searching for the Start() and Update() methods in the Scripting API to gain a better understanding of what they do in Unity, and when. 
  • If you're feeling brave, go the extra step and have a look at the MonoBehavior class in the manual for a more detailed explanation.

Before jumping into our C# programming adventure too deeply, we need to address one final, crucial building block – communication between classes. 

Communication among classes

Up until now, we've described classes and, by extension, Unity components, as separate standalone entities; in reality, they are deeply intertwined. You'd be hard-pressed to create any kind of meaningful software application without invoking some kind of interaction or communication between classes.

If you remember the post-office example from earlier, the example code made use of periods (or dots) to reference classes, variables, and methods. If you think of classes as directories of information, then dot notation is the indexing tool: 

PostOffice.Address

Any variables, methods, or other data types within a class can be accessed with dot notation. This applies to nested, or subclass information as well, but we'll tackle all those subjects when we get to Chapter 5, Working with Classes and Object-Oriented Programming

Dot notation is also what drives communication between classes. Whenever a class needs information about another class or wants to execute one of its methods, dot notation is used:

PostOffice.DeliverMail()
Dot notation is sometimes referred to as (.) Operator, so don't be thrown off if you see it mentioned this way in the documentation.

If dot notation doesn't quite click with you yet, don't worry, it will. It's the bloodstream of the entire programming body, carrying information and context wherever it's needed.

Summary

We've come a long way in a few short pages, but understanding the overarching theory of fundamental concepts such as variables, methods, and classes will give you a strong foundation to build on. Bear in mind that these building blocks have very real counterparts in the real world. Variables hold values like mailboxes hold letters; methods store instructions like recipes, to be followed for a predefined result; and classes are blueprints just like real blueprints. You can't build a house without a well thought out design to follow if you expect it to stay standing.

The rest of this book will take you on a deep dive into C# syntax from scratch, starting with more detail in the next chapter on how to create variables, manage value types, and work with simple and complex methods.

Pop quiz – C# building blocks

  1. What is the main purpose of a variable?
  2. What role do methods play in scripts?
  3. How does a script become a component?
  4. What's the purpose of dot notation?
Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Understand C# programming basics, terminology, and coding best practices
  • Put your knowledge of C# concepts into practice by building a fun and playable game
  • Come away with a clear direction for taking your C# programming and Unity game development skills to the next level

Description

Over the years, 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 that can be applied in a wide array of application areas. This book presents a clear path for learning C# programming from the ground up without complex jargon or unclear programming logic, all while building a simple game with Unity. This fifth edition has been updated to introduce modern C# features with the latest version of the Unity game engine, and a new chapter has been added on intermediate collection types. Starting with the basics of software programming and the C# language, you’ll learn the core concepts of programming in C#, including variables, classes, and object-oriented programming. Once you’ve got to grips with C# programming, you’ll enter the world of Unity game development and discover how you can create C# scripts for simple game mechanics. Throughout the book, you’ll gain hands-on experience with programming best practices to help you take your Unity and C# skills to the next level. By the end of this book, you’ll be able to leverage the C# language to build your own real-world Unity game development projects.

Who is this book for?

If you’re a developer, programmer, hobbyist, or anyone who wants to get started with C# programming in a fun and engaging manner, this book is for you. Prior experience in programming or Unity is not required.

What you will learn

  • Discover easy-to-follow steps and examples for learning C# programming fundamentals
  • Get to grips with creating and implementing scripts in Unity
  • Create basic game mechanics such as player controllers and shooting projectiles using C#
  • Understand the concepts of interfaces and abstract classes
  • Leverage the power of the latest C# features to solve complex programming problems
  • Become familiar with stacks, queues, exceptions, error handling, and other core C# concepts
  • Explore the basics of artificial intelligence (AI) for games and implement them to control enemy behavior

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Aug 21, 2020
Length: 366 pages
Edition : 5th
Language : English
ISBN-13 : 9781800204447
Languages :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Aug 21, 2020
Length: 366 pages
Edition : 5th
Language : English
ISBN-13 : 9781800204447
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 137.97
Learning C# by Developing Games with Unity 2020
€41.99
C# 9 and .NET 5 – Modern Cross-Platform Development
€62.99
Hands-On Unity 2020 Game Development
€32.99
Total 137.97 Stars icon
Banner background image

Table of Contents

15 Chapters
Getting to Know Your Environment Chevron down icon Chevron up icon
The Building Blocks of Programming Chevron down icon Chevron up icon
Diving into Variables, Types, and Methods Chevron down icon Chevron up icon
Control Flow and Collection Types Chevron down icon Chevron up icon
Working with Classes, Structs, and OOP Chevron down icon Chevron up icon
Getting Your Hands Dirty with Unity Chevron down icon Chevron up icon
Movement, Camera Controls, and Collisions Chevron down icon Chevron up icon
Scripting Game Mechanics Chevron down icon Chevron up icon
Basic AI and Enemy Behavior Chevron down icon Chevron up icon
Revisiting Types, Methods, and Classes Chevron down icon Chevron up icon
Introducing Stacks, Queues, and HashSets Chevron down icon Chevron up icon
Exploring Generics, Delegates, and Beyond Chevron down icon Chevron up icon
The Journey Continues Chevron down icon Chevron up icon
Pop Quiz Answers Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.5
(39 Ratings)
5 star 79.5%
4 star 5.1%
3 star 7.7%
2 star 5.1%
1 star 2.6%
Filter icon Filter
Top Reviews

Filter reviews by




Hugo Oroño Dec 16, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Good book to learn how to program in C#
Amazon Verified review Amazon
Eduardo Leal Mar 27, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Bem completo.
Amazon Verified review Amazon
Kindle-Kunde Mar 01, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I like the learning progress in this book and the way how it's explained. For me, this is the introduction in C# was I looking for. Thank you!
Amazon Verified review Amazon
Mark Lassoff Jan 30, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
What a fun way to learn Unity and C#! I liked this book so much I included it in my list of the Ten Best Books for New Programmers in 2020-- But you don't have to be a new programmer to enjoy this book. If you're a current developer wanting to learn C# and/or Unity, I think Harrison's book will do the trick.This book manages to "thread the needle" well when giving strong coverage to the Unity environment and a comprehensive introduction to C#. The book clearly explains both fundamental topics like variables, but, doesn't shy away from the more complex topics, like C# generics. The author has a knack for good, clear explanations.This book should be on your shelf if you have any interest in C# or Unity! One of my favorites!
Amazon Verified review Amazon
Jarvis Hill Oct 18, 2020
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I really love this book. It goes into so much detail and explains every little aspect of C#. This is the book that I wish I had access to when I first started learning to code in Unity. It even gave me a better understanding of some of the things that I previously thought I understood. I even introduce me to a few simple things that I previously wasn't using like interpolated strings. I would highly recommend this book to any new developer learning to code in C#.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.