Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Learning C# by Developing Games with Unity 6

You're reading from   Learning C# by Developing Games with Unity 6 Get to grips with coding in C# and build simple 3D games in Unity from the ground up

Arrow left icon
Product type Paperback
Published in Oct 2025
Publisher Packt
ISBN-13 9781805808718
Length 504 pages
Edition 8th Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Harrison Ferrone Harrison Ferrone
Author Profile Icon Harrison Ferrone
Harrison Ferrone
Arrow right icon
View More author details
Toc

Table of Contents (20) Chapters Close

Preface
1. Getting to Know Your Environment 2. The Building Blocks of Programming FREE CHAPTER 3. Diving into Variables, Types, and Methods 4. Control Flow and Collection Types 5. Working with Classes, Structs, and OOP 6. Getting Your Hands Dirty with Unity 7. Movement, Camera Controls, and Collisions 8. Scripting Game Mechanics 9. Basic AI and Enemy Behavior 10. Revisiting Types, Methods, and Classes 11. Specialized Collection Types and LINQ 12. Saving, Loading, and Serializing Data 13. Connecting to the World Wide Web 14. Exploring Generics, Delegates, and Beyond 15. The Journey Continues 16. Unlock Your Book’s Exclusive Benefits
17. Pop Quiz Answers
18. Other Books You May Enjoy
19. Index

Defining variables

To start, we need to ask ourselves a simple question: what is a variable? Depending on your point of view, there are a few different ways of answering this question (all of which are valid):

  • Conceptually, a variable is the most basic unit of programming, as an atom is to the physical world (except in 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 whenever you want, 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!

You can find an in-depth explanation of variables...

Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Learning C# by Developing Games with Unity 6
You have been reading a chapter from
Learning C# by Developing Games with Unity 6 - Eighth Edition
Published in: Oct 2025
Publisher: Packt
ISBN-13: 9781805808718
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Modal Close icon
Modal Close icon