Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Learning C# by Developing Games with Unity 2020 - Fifth Edition

You're reading from  Learning C# by Developing Games with Unity 2020 - Fifth Edition

Product type Book
Published in Aug 2020
Publisher Packt
ISBN-13 9781800207806
Pages 366 pages
Edition 5th Edition
Languages
Author (1):
Harrison Ferrone Harrison Ferrone
Profile icon Harrison Ferrone

Table of Contents (16) Chapters

Preface 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 Exploring Generics, Delegates, and Beyond The Journey Continues Pop Quiz Answers Other Books You May Enjoy

Selection statements

The most complex programming problems can often be boiled down to sets of simple choices that a game or program evaluates and acts on. Since Visual Studio and Unity can't make those choices by themselves, writing out those decisions is up to us.

The if-else and switch selection statements allow you to specify branching paths, based on one or more conditions, and the actions you want to be taken in each case. Traditionally, these conditions include the following:

  • Detecting user input
  • Evaluating expressions and Boolean logic
  • Comparing variables or literal values

You're going to start with the simplest of these conditional statements, if-else, in the following section.

lock icon The rest of the chapter is locked
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 $15.99/month. Cancel anytime}