Learning C# by Developing Games with Unity 3D Beginner's Guide
eBook - ePub

Learning C# by Developing Games with Unity 3D Beginner's Guide

Terry Norton

  1. 292 Seiten
  2. English
  3. ePUB (handyfreundlich)
  4. Über iOS und Android verfĂŒgbar
eBook - ePub

Learning C# by Developing Games with Unity 3D Beginner's Guide

Terry Norton

Angaben zum Buch
Buchvorschau
Inhaltsverzeichnis
Quellenangaben

Über dieses Buch

In Detail

For the absolute beginner to any concept of programming, writing a script can appear to be an impossible hurdle to overcome. The truth is, there are only three simple concepts to understand: 1) having some type of information; 2) using the information; and 3) communicating the information. Each of these concepts is very simple and extremely important. These three concepts are combined to access the feature set provided by Unity.

"Learning C# by Developing Games with Unity 3D" assumes that you know nothing about programming concepts. First you will learn the absolute basics of programming using everyday examples that you already know. As you progress through the book, you will find that C# is not a foreign language after all, because you already know the words. With a few keywords and using substitution, before you know it, you'll be thinking in code.

The book starts by explaining in simple terms the three concepts you need for writing C# code and scripts: 1) variables to hold information; 2) methods (functions) to use the information; and 3) Dot Syntax to communicate the information where it's needed. The book builds on these concepts to open up the world of C# coding and Unity scripting. You will use this new power to access the features provided in Unity's Scripting Reference.

The first half of this book is devoted to the code writing beginner. The concepts of variables, methods, Dot Syntax, and decision processing are fully explained. Since C# is an actual programming language, we take advantage of this to develop a State Machine to help control and organize each phase of a Unity project. Once the basic programming concepts are established and we have some State Machine organization, the features and power of Unity are accessed using the Scripting Reference.

The goal of "Learning C# by Developing Games with Unity 3D" is to teach to you how to use the Unity Scripting Reference.

Approach

This book uses the learning-by-example approach. It takes simple examples from games to introduce all the main concepts of programming in an easy-to-digest and immediately recognizable way.

Who this book is for

This book is for the total beginner to any type of programming, focusing on the writing of C# code and scripts only. There are many parts that make up the Unity game engine. It is assumed that the reader already knows their way around Unity's user interface. The code editor used in this book is the MonoDevelop editor supplied by Unity.

HĂ€ufig gestellte Fragen

Wie kann ich mein Abo kĂŒndigen?
Gehe einfach zum Kontobereich in den Einstellungen und klicke auf „Abo kĂŒndigen“ – ganz einfach. Nachdem du gekĂŒndigt hast, bleibt deine Mitgliedschaft fĂŒr den verbleibenden Abozeitraum, den du bereits bezahlt hast, aktiv. Mehr Informationen hier.
(Wie) Kann ich BĂŒcher herunterladen?
Derzeit stehen all unsere auf MobilgerĂ€te reagierenden ePub-BĂŒcher zum Download ĂŒber die App zur VerfĂŒgung. Die meisten unserer PDFs stehen ebenfalls zum Download bereit; wir arbeiten daran, auch die ĂŒbrigen PDFs zum Download anzubieten, bei denen dies aktuell noch nicht möglich ist. Weitere Informationen hier.
Welcher Unterschied besteht bei den Preisen zwischen den AboplÀnen?
Mit beiden AboplÀnen erhÀltst du vollen Zugang zur Bibliothek und allen Funktionen von Perlego. Die einzigen Unterschiede bestehen im Preis und dem Abozeitraum: Mit dem Jahresabo sparst du auf 12 Monate gerechnet im Vergleich zum Monatsabo rund 30 %.
Was ist Perlego?
Wir sind ein Online-Abodienst fĂŒr LehrbĂŒcher, bei dem du fĂŒr weniger als den Preis eines einzelnen Buches pro Monat Zugang zu einer ganzen Online-Bibliothek erhĂ€ltst. Mit ĂŒber 1 Million BĂŒchern zu ĂŒber 1.000 verschiedenen Themen haben wir bestimmt alles, was du brauchst! Weitere Informationen hier.
UnterstĂŒtzt Perlego Text-zu-Sprache?
Achte auf das Symbol zum Vorlesen in deinem nÀchsten Buch, um zu sehen, ob du es dir auch anhören kannst. Bei diesem Tool wird dir Text laut vorgelesen, wobei der Text beim Vorlesen auch grafisch hervorgehoben wird. Du kannst das Vorlesen jederzeit anhalten, beschleunigen und verlangsamen. Weitere Informationen hier.
Ist Learning C# by Developing Games with Unity 3D Beginner's Guide als Online-PDF/ePub verfĂŒgbar?
Ja, du hast Zugang zu Learning C# by Developing Games with Unity 3D Beginner's Guide von Terry Norton im PDF- und/oder ePub-Format sowie zu anderen beliebten BĂŒchern aus Computer Science & Computer Science General. Aus unserem Katalog stehen dir ĂŒber 1 Million BĂŒcher zur VerfĂŒgung.

Information

Jahr
2013
ISBN
9781849696586

Learning C# by Developing Games with Unity 3D Beginner's Guide


Table of Contents

Learning C# by Developing Games with Unity 3D Beginner's Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Time for action – heading
What just happened?
Pop quiz – heading
Have a go hero – heading
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Discovering Your Hidden Scripting Skills
Prerequisite knowledge for using this book
Dealing with scriptphobia
Teaching behaviors to GameObjects
Choosing to use C# instead of UnityScript
Reason 1 for choosing C# – vast amount of documentation on the Internet
Reason 2 for choosing C# – flexibility to use Unity scripts and regular C# code files
Reason 3 for choosing C# – coding rules are specific
Maneuvering around Unity's documentation
Time for action – opening the Reference Manual documentation for the transform Component
What just happened?
Time for action – opening the scripting reference documentation for the transform component
What just happened?
Are we really supposed to know all that stuff?
What is all that information?
Working with C# script files
Time for action – create a C# script file
What just happened?
Introducing the MonoDevelop code editor
Syncing C# files between MonoDevelop and Unity
Time for action – opening LearningScript in MonoDevelop
What just happened?
Watching for a possible "gotcha" when creating script files in Unity
Fixing sync if it isn't working properly
Pop quiz – dealing with scripts
Summary
2. Introducing the Building Blocks for Unity Scripts
Using the term method instead of function
Understanding what a variable does in a script
Naming a variable
A variable name is just a substitute for a value
Time for action – creating a variable and seeing how it works
What just happened?
Time for action – changing the number 9 to a different number
What just happened?
Have a go hero – changing the value of myNumber
Using a method in a script
What is a method?
Time for action – learning how a method works
What's in this script file?
Method names are substitutes too
What just happened?
Have a go hero – changing the output of the method
Introducing the class
By using a little Unity magic, a script becomes a Component
A more technical look at the magic
Even more Unity magic
Have a go hero – finding Start and Update in the Scripting Reference
Components communicating using the Dot Syntax
What's with the dots?
Pop quiz – knowing the C# building blocks
Summary
3. Getting into the Details of Variables
Writing C# statements properly
Understanding Component properties in Unity's Inspector
Variables become Component properties
Unity changes script and variable names slightly
Changing a property's value in the Inspector panel
Displaying public variables in the Inspector panel
Time for action – making a variable private
What just happened?
Naming your variables properly
Begin variable names with lowercase
Using multi-word variable names
Have a go hero – viewing multi-word variables in the Inspector panel
Declaring a variable and its type
The most common built-in variable types
Time for action – assigning values while declaring the variable
What just happened?
Where you declare a variable is important
Variable scope – determining where a variable can be used
Pop quiz – knowing how to declare a variable
Summary
4. Getting into the Details of Methods
Ending a method definition using curly braces
Using methods in a script
Naming methods properly
Begin method names with an uppercase letter
Using multi-word names for a method
Parentheses are part of the method name
Defining a method properly
The minimum requirements for defining a method
Understanding parentheses – why are they there?
Time for action – adding code between the parentheses
What just happened?
Specifying a method's parameters
How many parameters can a method have?
Calling a method
Using arguments in the parentheses of a method
Returning a value from a method
Time for action – returning a value from AddTwoNumbers()
What just happened?
Have a go hero – add two more numbers together
Calling a method is a logic detour
Using Unity's Update and Start methods
The Start method is called one time...

Inhaltsverzeichnis

Zitierstile fĂŒr Learning C# by Developing Games with Unity 3D Beginner's Guide

APA 6 Citation

Norton, T. (2013). Learning C# by Developing Games with Unity 3D Beginner’s Guide (1st ed.). Packt Publishing. Retrieved from https://www.perlego.com/book/390208/learning-c-by-developing-games-with-unity-3d-beginners-guide-pdf (Original work published 2013)

Chicago Citation

Norton, Terry. (2013) 2013. Learning C# by Developing Games with Unity 3D Beginner’s Guide. 1st ed. Packt Publishing. https://www.perlego.com/book/390208/learning-c-by-developing-games-with-unity-3d-beginners-guide-pdf.

Harvard Citation

Norton, T. (2013) Learning C# by Developing Games with Unity 3D Beginner’s Guide. 1st edn. Packt Publishing. Available at: https://www.perlego.com/book/390208/learning-c-by-developing-games-with-unity-3d-beginners-guide-pdf (Accessed: 14 October 2022).

MLA 7 Citation

Norton, Terry. Learning C# by Developing Games with Unity 3D Beginner’s Guide. 1st ed. Packt Publishing, 2013. Web. 14 Oct. 2022.