The beauty of this book is that it assumes absolutely no knowledge of coding at all. Starting from very first principles it will end up giving you an excellent grounding in the writing of C# code and scripts. Overview 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 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 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. What you will learn from this book
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.
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.
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.
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.
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.
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.