Ferrone | Learning C# by Developing Games with Unity 2021 | E-Book | www.sack.de
E-Book

E-Book, Englisch, 428 Seiten

Ferrone Learning C# by Developing Games with Unity 2021

Kickstart your C# programming and Unity journey by building 3D games from scratch
6. Auflage 2024
ISBN: 978-1-80181-296-2
Verlag: De Gruyter
Format: EPUB
Kopierschutz: 0 - No protection

Kickstart your C# programming and Unity journey by building 3D games from scratch

E-Book, Englisch, 428 Seiten

ISBN: 978-1-80181-296-2
Verlag: De Gruyter
Format: EPUB
Kopierschutz: 0 - No protection



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.

Ferrone Learning C# by Developing Games with Unity 2021 jetzt bestellen!

Autoren/Hrsg.


Weitere Infos & Material


Table of Contents - Getting to Know Your Environment
- The Building Blocks of Programming
- Diving into Variables, Types, and Methods
- Control Flow and Collection Types
- Working with Classes, Structs, and OOP
- Getting Your Hands Dirty with Unity
- Movement, Camera Controls, and Collisions
- Scripting Game Mechanics
- Basic AI and Enemy Behavior
- Revisiting Types, Methods, and Classes
- Introducing Stacks, Queues, and HashSets
- Saving, Loading, and Serializing Data
- Exploring Generics, Delegates, and Beyond
- The Journey Continues


Preface


Unity is one of the most popular game engines in the world, catering to hobbyists, professional AAA studios, and cinematic production companies. While known for its use as a 3D tool, Unity has a host of dedicated features supporting everything from 2D games and virtual reality to post-production and cross-platform publishing.

Developers love its drag-and-drop interface and built-in features, but it's the ability to write custom C# scripts for behaviors and game mechanics that really takes Unity the extra mile. Learning to write C# code might not be a huge obstacle to a seasoned programmer with other languages under their belt, but it can be daunting for those of you who have no programming experience. That's where this book comes in, as I'll be taking you through the building blocks of programming and the C# language from scratch while building a fun and playable game prototype in Unity.

Who this book is for


This book was written for those of you who don't have any experience with the basic tenets of programming or C#. However, if you're a competent novice or seasoned professional coming from another language, or even C#, but need to get hands-on with game development in Unity, this is still where you want to be.

What this book covers


, , starts off with the Unity installation process, the main features of the editor, and finding documentation for C# and Unity-specific topics. We'll also go through creating C# scripts from inside Unity and take a look at Visual Studio, the application where all our code editing takes place.

, , begins by laying out the atomic-level concepts of programming, giving you the chance to relate variables, methods, and classes to situations in everyday life. From there, we move on to simple debugging techniques, proper formatting and commenting, and how Unity turns C# scripts into components.

, , takes a deeper look at the building blocks from . This includes C# data types, naming conventions, access modifiers, and everything else you'll need for the foundation of a program. We'll also go over how to write methods, add parameters, and use return types, ending with an overview of standard Unity methods belonging to the class.

, , introduces the common approaches to making decisions in code, consisting of the and statements. From there, we move on to working with arrays, lists, and dictionaries, and incorporating iteration statements for looping through collection types. We end the chapter with a look at conditional looping statements and a special C# data type called enumerations.

, , details our first contact with constructing and instantiating classes and structs. We'll go through the basic steps of creating constructors, adding variables and methods, and the fundamentals of subclassing and inheritance. The chapter will end with a comprehensive explanation of object-oriented programming and how it applies to C#.

, , marks our departure from C# syntax into the world of game design, level building, and Unity's featured tools. We'll start by going over the basics of a game design document and then move on to blocking out our level geometry and adding lighting and a simple particle system.

, , explains different approaches to moving a player object and setting up a third-person camera. We'll discuss incorporating Unity physics for more realistic locomotion effects, as well as how to work with collider components and capture interactions within a scene.

, , introduces the concept of game mechanics and how to effectively implement them. We'll start by adding a simple jump action, create a shooting mechanic, and build on the previous chapters' code by adding logic to handle item collection.

, , starts with a brief overview of artificial intelligence in games and the concepts we will be applying to Hero Born. Topics covered in this chapter will include navigation in Unity, using the level geometry and a navigation mesh, smart agents, and automated enemy movement.

, , takes a more in-depth look at data types, intermediate method features, and additional behaviors that can be used for more complex classes. This chapter will give you a deeper understanding of the versatility and breadth of the C# language.

, , dives into intermediate collection types and their features. Topics covered in this chapter include using Stacks, Queues, and HashSets and the different development scenarios that each is uniquely suited for.

, , gets you ready to handle your games information. Topics covered in this chapter include working with the filesystem and creating, deleting, and updating files. We'll also cover different data types including XML, JSON, and binary data, and end with a practical discussion on serializing C# objects directly into data formats.

, , details intermediate features of the C# language and how to apply them in practical, real-world scenarios. We'll start with an overview of generic programming and progress to concepts such as delegation, events, and exception handling.

, , reviews the main topics you've learned throughout the book and leaves you with resources for further study in both C# and Unity. Included in these resources will be online reading material, certification information, and a host of my favorite video tutorial channels.

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.

: 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 folder."

A block of code is set as follows:

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

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."

Get in touch


Feedback from our readers is always welcome.

General feedback: Email , and mention the book's title in the subject of your message. If you have questions about any aspect of this book, please email us at...


Ferrone Harrison :

Harrison Ferrone is an instructional content creator for LinkedIn Learning and Pluralsight, tech editor for the Ray Wenderlich website, and used to write technical documentation on the Mixed Reality team at Microsoft. He is a graduate of the University of Colorado at Boulder and Columbia College, Chicago. After a few years as an iOS developer at small start-ups, and one Fortune 500 company, he fell into a teaching career and never looked back.



Ihre Fragen, Wünsche oder Anmerkungen
Vorname*
Nachname*
Ihre E-Mail-Adresse*
Kundennr.
Ihre Nachricht*
Lediglich mit * gekennzeichnete Felder sind Pflichtfelder.
Wenn Sie die im Kontaktformular eingegebenen Daten durch Klick auf den nachfolgenden Button übersenden, erklären Sie sich damit einverstanden, dass wir Ihr Angaben für die Beantwortung Ihrer Anfrage verwenden. Selbstverständlich werden Ihre Daten vertraulich behandelt und nicht an Dritte weitergegeben. Sie können der Verwendung Ihrer Daten jederzeit widersprechen. Das Datenhandling bei Sack Fachmedien erklären wir Ihnen in unserer Datenschutzerklärung.