Jump to ratings and reviews
Rate this book

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

Rate this book
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.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.

292 pages, Kindle Edition

First published January 1, 2013

4 people are currently reading
38 people want to read

About the author

Terry Norton

11 books

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
5 (17%)
4 stars
9 (32%)
3 stars
10 (35%)
2 stars
3 (10%)
1 star
1 (3%)
Displaying 1 - 8 of 8 reviews
Profile Image for Xianshun Chen.
90 reviews4 followers
February 3, 2021
The book teaches some simple programming in C#, but does provide in a succinct way how to do C# coding in Unity environment, which is suitable for my case as i know quite a lot about C# but nothing about Unity development. So in a sense the book is also good for programmers who previously know nothing about Unity IDE and wonder how to add codes to a game to modify game behavior (kind of like a teach yourself in 6 hours books on how to start code on Unity).

The first 6 chapters basically a hello-world C# tutorial, with some minor examples of:

1. how to create and attach script to game objects, how to get game object using GameObject.Find("[gameObjectId]"),

2. how to get the MonoBehavior sub-class script object attached to a game object (i.e. the class defined in a script attached in a game object) using thisScriptInstance.GetComponent (where ClassName refers to the class name of the MonoBehavior sub-class)

3. how to rotate a game object, by calling its transform.Rotate(x, y, z) method

4. How to expose a script object's variable as property in the Unity Inspector panel (by declaring the variable as public)

5. Where to add script behavior during game initialization (i.e. in the Start() method) and game update (i.e. in the Update() method) or for GUI output (i.e. in the OnGUI() method)

Chapter 7 teach about a simple design of a state machine and its implementation (as a script object derived from MonoBehavior)

Chapter 8 delves a bit more into implementation of individual state. Not much interesting stuff except the part where it shows how to use Unity API to interact with Unity engine, such as

1. add codes to pause a game scene (by settings Time.timeScale = 0) and restart again (by settings Time.timeScale=1). The Time.timeScale sets the game speed. Time.realtimeSinceStartup is another interesting property which returns the time in seconds from the start of the game.

2. Some basic Unity properties and method including:

Screen.width: width of the game screen
Screen.Height: height of the game screen.

bool GUI.Button(Rect rect, String text): create a button on the game screen, the return value can be used implement logics run when it return true (i.e. onClick) or false. Note that this method must be called inside the OnGUI() of a MonoBehavior object

bool GUI.Box(Rect rect, String text): a label on the game screen. Note that this method must be called inside the OnGUI() of a MonoBehavior object.

3. How to attach a script object to an empty game object (by selecting GameObject-->Create Empty, then attach a script to it by dragging the script onto the create empty game object in the Unity Hierarchy panel). This is good for, e.g., when building a Unity scene of a GUI panel for game settings and configuration.

4. How to implement logic in the MonoBehavior.Awake() method override to persists an object across multiple scenes (via static member variable and DontDestroyOnload(this.gameObject) and DestroyImmeidate(this.gameObject))

5. How to switch between different scenes using Application.LoadLevel("[sceneName]") (all scenes must be in the "Scenes In Build" accessed via File-->Build Settings)

While the first 8 chapters to most C# programmers is not worth much except for some of the stuffs mentioned above.

By the way, Chapter 9 and Chapter 10 is worth some reading for Unity programming using C#
This entire review has been hidden because of spoilers.
Profile Image for Justin.
21 reviews2 followers
August 3, 2017
Good up until the state machine. I prefer the second edition over the first edition.
Profile Image for Manar.
9 reviews
July 5, 2023
كتاب رائع لتعلم برمجة الالعاب باستخدام اليونتي للمبتدئين
Profile Image for Jaime.
66 reviews2 followers
May 12, 2015
Overall pretty good introduction and easy to understand. It does feel a bit like half of a book though as it ends fairly abruptly and covers little more than setting up a state machine in the Unity engine. Definitely worth taking a look at but it will leave you wanting more.
Profile Image for Jordan Vicencio.
23 reviews
July 21, 2015
This book has some useful bits to those that are new to C# but in some parts there aren't much explanations and you need to search more details and reread it. At the end, it seem that the author are in a hurry to finish it and puts a lot of codes without much effort.
5 reviews
May 27, 2014
Liked upto chapter 9, lots of codes I'll have to go back to. The game itself could've been better with assets provided, only code is provided in the website.
Profile Image for Nicholas Weaver.
6 reviews
January 1, 2016
Good crash course in unity C# scripting, but I had a lot of issues towards the end with broken scripts, which needed to be researched online to address.
Profile Image for Majid.
26 reviews
April 18, 2017
It's a book that broke my nightmare of starting to learn programming.
Highly recommended for anyone who know nothing about the the subject but willing to learn from a safe, interesting, powerful start point.
Displaying 1 - 8 of 8 reviews

Can't find what you're looking for?

Get help and learn more about the design.