Book Image

Unity Android Game Development by Example Beginner's Guide

By : Thomas James Finnegan
Book Image

Unity Android Game Development by Example Beginner's Guide

By: Thomas James Finnegan

Overview of this book

Powerful and continuing to grow, the mobile market has never been bigger and more demanding of great games. Android continues to prove itself as a strong contender in this challenging market. With Unity 3D, great games can be made for Android quickly and easily. With its great deployment system, the Android platform is now only one click away. Unity Android Game Development by Example Beginner's Guide dives straight into making real, fully-functional games, with hands-on examples and step-by-step instructions to give you a firm grounding in Unity 3D and Android. Everything necessary for creating a complete gaming experience is covered and detailed throughout the course of this book. Using clear and practical examples that progressively build upon each other, this book guides you through the process of creating games in Unity for Android. Start by learning about all the great features that Unity and Android have to offer. Next, create a Tic-Tac-Toe game while learning all about interfaces. After that, learn about meshes, materials, and animations with the creation of a tank battle game. You will then learn how to expand your game's environment with the addition of shadows and a skybox. Adding on this, you will also learn how to expand the tank battle by creating enemies and using path finding to chase the player. Next, explore touch and tilt controls with the creation of a space fighter game. Then, learn about physics while recreating the most popular mobile game on the market. You will then expand the space fighter game with the addition of all the special effects that make a game great. Finally, complete your experience by learning the optimization techniques required to keep your games running smoothly. While Unity is available for both Mac and Windows, the book is presented working from a Windows environment. Programming in Unity is possible in C#, JavaScript, and Boo. This book will be working in C# and the final projects will be provided in C# and JavaScript. From nothing to a fully-featured mobile game, Unity Android Game Development by Example Beginner's Guide takes you through everything it takes to create your next game for the Android platform.
Table of Contents (17 chapters)
Unity Android Game Development by Example Beginner's Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Time for action – simple device connection


The simple device-connection method involves changing a few settings and a little work in the command prompt. It might seem a little scary but if all goes well, you will be connected to your device shortly.

  1. The first thing we need to do is turn on some developer settings on the phone. At the top of the settings page, there should be a Development option; select it. If you do not have that option, look for an Applications option.

  2. Find the Unknown sources check box and check it. This lets us install our development applications on the device.

  3. The next checkbox to be checked is USB debugging. This allows us to actually detect our device from the development environment.

  4. If you are using Kindle, be sure to go into Security and turn on Enable ADB as well.

    Tip

    There are several warning pop ups that are associated with turning these various options on. They essentially amount to the same malicious software warnings associated with your computer. Applications with immoral intentions can mess with your system and get to your private information. All these settings need to be turned on if your device is only going to be used for development. But, as the warnings suggest, if malicious applications are a concern, turn them off when not developing.

  5. Next, start a command prompt. This can be done most easily by hitting your Windows key, typing cmd.exe, and hitting Enter.

  6. We now need to navigate to the ADB commands. If you did not install to the default location, replace the path in the following commands with the path you installed to.

    • If you are running a 32-bit version of Windows and installed to the default location, type the following in the command prompt:

      cd c:\program files\android\android-sdk\platform-tools
      
    • If you are running a 64-bit version, type the following in the command prompt:

      cd c:\program files (x86)\android\android-sdk\platform-tools
      
  7. Now connect your device to your computer, preferably using the USB cable that came with it.

  8. Wait for your computer to finish recognizing the device. There should be a "Device drivers installed" type of message pop-up when it is done.

  9. The following command lets us see which devices are currently connected and recognized by the ADB system. Emulated devices will show up as well. Type into the command prompt:

    adb devices
    
  10. After a short pause for processing, the command prompt will display a list of devices attached along with the unique IDs of all attached devices. If this list now contains your device, congratulations, you have a developer-friendly device. If not, things get a little trickier.

What just happened?

We made our first attempt at connecting to our Android devices. For most, this should be all that you need to connect to your device. For some, this process is not quite enough. The next little section covers solutions to resolve the issue.