Book Image

Learning C# by Developing Games with Unity 5.x - Second Edition

Book Image

Learning C# by Developing Games with Unity 5.x - Second Edition

Overview of this book

Unity is a cross-platform game engine that is used to develop 2D and 3D video games. Unity 5 is the latest version, released in March 2015, and adds a real-time global illumination to the games, and its powerful new features help to improve a game’s efficiency. This book will get you started with programming behaviors in C# so you can create 2D games in Unity. You will begin by installing Unity and learning about its features, followed by creating a C# script. We will then deal with topics such as unity scripting for you to understand how codes work so you can create and use C# variables and methods. Moving forward, you will find out how to create, store, and retrieve data from collection of objects. You will also develop an understanding of loops and their use, and you’ll perform object-oriented programming. This will help you to turn your idea into a ready-to-code project and set up a Unity project for production. Finally, you will discover how to create the GameManager class to manage the game play loop, generate game levels, and develop a simple UI for the game. By the end of this book, you will have mastered the art of applying C# in Unity.
Table of Contents (20 chapters)
Learning C# by Developing Games with Unity 5.x Second Edition
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Downloading Unity


You have probably already installed and activated Unity. Where you should look for the latest Unity version and license might be obvious. However, I've noticed lots of questions online about where you can get Unity for free, and so I decided to cover this subject. If you feel that this step is obsolete for you, skip this part.

The best place to download your Unity copy from is, of course, Unity's official website: http://unity3d.com/unity/download.

In this book, we will be covering Unity Version 5.0 and higher. We need to download the latest version of Unity and install it with all components ticked. It's a good idea to install Unity with the example project. The Unity Example project (the Angry Bots game) is there for us to play with, experiment, and learn.

Obtaining a free license

The easiest way to obtain a Unity license is by simply launching Unity for the first time. The following steps will guide you to do so:

  1. Unity will present the Activate your Unity license window. Click on OK, as shown here:

  2. Fill in your details so that Unity Technologies can send you your Unity free license code:

  3. You should receive a verification e-mail with a confirm email button. Once you have clicked on it, you should be able to log in to Unity.

You are now all set with the latest version of Unity and a free license!