Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Unity Android Game Development by Example Beginner's Guide
Unity Android Game Development by Example Beginner's Guide

Unity Android Game Development by Example Beginner's Guide: Absolute beginners to designing games for Android will find this book is their passport to quick results. Lots of handholding and practical exercises using Unity 3D makes learning a breeze.

eBook
€8.99 €29.99
Paperback
€36.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Table of content icon View table of contents Preview book icon Preview Book

Unity Android Game Development by Example Beginner's Guide

Chapter 1. Saying Hello to Unity and Android

Welcome to the wonderful world of mobile game development. Whether you are still looking for the right development kit or have already chosen one, this chapter will be most important. In this chapter we explore the various features that come with choosing Unity as your development environment and Android as the target platform. Through comparison with major competitors, it is discovered why Unity and Android stand on the top of the pile. Following that, we examine how Unity and Android work together. Finally, the development environment is set up and we create a simple Hello World application to test that everything is set up correctly. For the purposes of this book, it is assumed you are working in a Windows-based environment.

In this chapter, we will cover the following topics:

  • Major Unity features
  • Major Android features
  • Unity licensing options
  • Installing the JDK
  • Installing the Android SDK
  • Installing Unity 3D
  • Installing Unity Remote

Understanding what makes Unity great

Perhaps the greatest feature of Unity is how open-ended it is. Nearly all game engines currently on the market are limited in what one can build. It makes perfect sense but it can limit the capabilities of a team. The average game engine has been highly optimized for creating a specific game type. This is great if all you plan on making is the same game again and again. When one is struck with inspiration for the next great hit, only to find that the game engine can't handle it and everyone has to retrain in a new engine or double the development time to make it capable, it can be quite frustrating. Unity does not suffer this problem. The developers of Unity have worked very hard to optimize every aspect of the engine, without limiting what types of games can be made. Everything ranging from simple 2D platformers to massive online role-playing games is possible in Unity. A development team that just finished an ultra-realistic first-person shooter can turn right around and make 2D fighting games without having to learn an entirely new system.

Being so open ended does, however, bring a drawback. There are no default tools optimized for building that perfect game. To combat this, Unity grants the ability to create any tool one can imagine, using the same scripting that creates the game. On top of that, there is a strong community of users that have supplied a wide selection of tools and pieces, both free and paid, to be quickly plugged in and used. This results in a large selection of available content, ready to jump-start you on your way to the next great game.

When many prospective users look at Unity, they think that because it is so cheap, it is not as good as an expensive AAA game engine. This is simply not true. Throwing more money at the game engine is not going to make a game any better. Unity supports all of the fancy shaders, normal maps, and particle effects you could want. The best part is, nearly all of the fancy features you could want are included in the free version of Unity and 90 percent of the time beyond that, one does not need to even use the Pro only features.

One of the greatest concerns when selecting a game engine, especially for the mobile market, is how much girth it will add to the final build size. Most are quite hefty. With Unity's code stripping, it becomes quite small. Code stripping is the process by which Unity removes every extra little bit of code from the compiled libraries. A blank project, compiled for Android, that utilizes full code stripping ends up being around 7 megabytes.

Perhaps one of the coolest features of Unity is the multi-platform compatibility. With a single project one can build for several different platforms. This includes the ability to simultaneously target mobile, PC, and consoles. This allows one to focus on real issues, such as handling inputs, resolution, and performance.

In the past, if a company desired to deploy their product on more than one platform, they had to nearly double the development costs in order to essentially reprogram the game. Every platform did, and still does, run by its own logic and language. Thanks to Unity, game development has never been simpler. We can develop games using simple and fast scripting, letting Unity handle the complex translation to each platform.

There are of course several other options for game engines. Two major ones that come to mind are cocos2d and Unreal Engine. While both are excellent choices, we can always find them to be a little lacking in certain respects.

The engine of Angry Birds, cocos2d, could be a great choice for your next mobile hit. However, as the name suggests, it is pretty much limited to 2D games. A game can look great in it, but if you ever want that third dimension, it can be tricky to add. A second major problem with cocos2d is how bare bones it is. Any tool for building or importing assets needs to be created from scratch, or they need to be found. Unless you have the time and experience, this can seriously slow down development.

Then there is the staple of major game development, Unreal Engine. This game engine has been used successfully by developers for many years, bringing great games to the world; Unreal Tournament and Gears of War not the least among them. These are both, however, console and computer games, which is the fundamental problem with the engine. Unreal is a very large and powerful engine. Only so much optimization can be done for mobile platforms. It has always had the same problem; it adds a lot of girth to a project and its final build. The other major issue with Unreal is its rigidity in being a first-person shooter engine. While it is technically possible to create other types of games in it, such tasks are long and complex. A strong working knowledge of the underlying system is a must before achieving such a feat.

All in all, Unity definitely stands strong among the rest. Perhaps you have already discovered this, and that is why you are reading this book. But these are still great reasons for choosing Unity for game development. Projects can look just as great as AAA titles. Overhead and girth in the final build is small and very important when working on mobile platforms. The system's potential is open enough to allow you to create any type of game you might want, where other engines tend to be limited to a single type of game. And should your needs change at any point in the project's life cycle, it is very easy to add, remove, or change your choice of target platforms.

Understanding what makes Android great

With over 30-million devices in the hands of users, why would you not choose the Android platform for your next mobile hit? Apple may have been the first one out of the gate with their iPhone sensation, but Android is definitely a step ahead when it comes to smartphone technology. One of its best features is its blatant ability to be opened up so you can take a look at how the phone works, both physically and technically. One can swap out the battery and upgrade the micro SD card, should the need arise. Plugging the phone into a computer does not have to be a huge ordeal; it can simply function as removable storage media.

From the point of view of cost of development, the Android market is superior as well. Other mobile app stores require an annual registration fee of about 100 dollars. Some also have a limit on the number of devices that can be registered for development at one time. The Google Play market has a one-time registration fee, and there is no concern about how many or what type of Android devices you are using for development.

One of the drawbacks about some of the other mobile development kits is that you have to pay an annual registration fee before you have access to the SDK. With some, registration and payment are required before you can view their documentation. Android is much more open and accessible. Anybody can download the Android SDK for free. The documentation and forums are completely viewable without having to pay any fee. This means development for Android can start earlier, with device testing being a part of it from the very beginning.

Understanding how Unity and Android work together

Because Unity handles projects and assets in a generic way, there is no need to create multiple projects for multiple target platforms. This means that you could easily start development with the free version of Unity and target personal computers. Then, at a later date, you can switch targets to the Android platform with the click of a button. Perhaps, shortly after your game is launched, it takes the market by storm and there is a great call to bring it to other mobile platforms. With just another click of the button, you can easily target iOS without changing anything in your project.

Most systems require a long and complex set of steps to get your project running on a device. For the first application in this book, we will be going through that process because it is important to know about it. However, once your device is set up and recognized by the Android SDK, a single-button click will allow Unity to build your application, push it to a device, and start running it. There is nothing that has caused more headaches for some developers than trying to get an application on a device. Unity makes it simple.

With the addition of a free Android application, Unity Remote, it is simple and easy to test mobile inputs without going through the whole build process. While developing, there is nothing more annoying than waiting for 5 minutes for a build every time you need to test a minor tweak, especially in the controls and interface. After the first dozen little tweaks the build time starts to add up. Unity Remote makes it simple and easy to test it all without ever having to hit the Build button.

These are the big three: generic projects, a one-click build process, and Unity Remote. We could, of course, come up with several more great ways in which Unity and Android can work together. But these three are the major time and money savers. You could have the greatest game in the world but, if it takes 10 times as long to build and test, what is the point?

Differences between Pro and Basic

Unity comes with two licensing options, Pro and Basic, which can be found at https://store.unity3d.com. In order to follow the bulk of this book, Unity Basic is all that is required. However, real-time shadows in Chapter 4, Setting the Stage – Camera Effects and Lighting, the whole of Chapter 5, Getting Around – Pathfinding and AI, and some of the optimization features discussed in Chapter 9, Optimization, will require Unity Pro. If you are not quite ready to spend the $3,000 required to purchase a full Unity Pro license with the Android add-on, there are other options. Unity Basic is free and comes with a 30-day free trial of Unity Pro. This trial is full and complete, just as if one has purchased Unity Pro. It is also possible to upgrade your license at a later date. Where Unity Basic comes with mobile options for free, Unity Pro requires the purchase of Pro add-ons for each of the mobile platforms.

License comparison overview

License comparisons can be found at http://unity3d.com/unity/licenses. This section will cover the specific differences between Unity Android Pro and Unity Android Basic. We will explore what the feature is and how useful it is.

  • NavMeshes, Pathfinding, and crowd Simulation: This feature is Unity's built-in pathfinding system. It allows characters to find their way from point to point around your game. Just bake your navigation data in the editor and let Unity take over at runtime. This feature is great if you don't have the ability or inclination to program a pathfinding system yourself. There is a whole slew of tutorials online about how to program pathfinding and do crowd simulation. It is completely possible to do all of this in Unity Basic; you just need to provide the tools yourself.
  • LOD Support: LOD (Level-of-detail) lets you control how complex a mesh is, based on its distance from the camera. When the camera is close to an object, render a complex mesh with a bunch of detail in it. When the camera is far from that object, render a simple mesh, because all that detail is not going to be seen anyway. Unity Pro provides a built-in system to manage this. However, this is another system that could be created in Unity Basic. Whether using Pro or not, this is an important feature for game efficiency. By rendering less complex meshes at a distance, everything can be rendered faster, leaving more room for awesome gameplay.
  • Audio Filter: Audio filters allow you to add effects to audio clips at runtime. Perhaps you created gravel footstep sounds for your character. Your character is running, and we can hear the footsteps just fine, when suddenly they enter a tunnel and a solar flare hits, causing a time warp and slowing everything down. Audio filters would allow us to warp the gravel footstep sounds to sound like they are coming from within a tunnel and are slowed by a time warp. Of course, you could also just have the audio guy create a new set of tunnel gravel footsteps in the time warp sounds. But this might double the amount of audio in your game and limits how dynamic we can be with it at runtime. We either are or are not playing the time warp footsteps. Audio filters would allow us to control how much time warp is affecting our sounds.
  • Video Playback and Streaming: When dealing with complex or high-definition cut scenes, being able to play a video becomes very important. Including them in a build especially with a mobile target can require a lot of space. This is where the streaming part of this feature comes in. This feature not only lets us play video, it also lets us stream that video from the internet. There is, however, a drawback to this feature. On mobile platforms, the video has to go through the device's built-in, video-playing system. This means the video can only be played full-screen and cannot be used as a texture. Theoretically, though, you could break your video into individual pictures for each frame and flip through them at runtime, but this is not recommended for build size and video quality reasons.
  • Fully Fledged Streaming with Asset Bundles: Asset bundles are a great feature provided by Unity Pro. They allow you to create extra content and stream it to the users, without ever requiring an update to the game. You could add new characters, levels, or just about any other content you can think of. Their only drawback is that you cannot add more code. The functionality cannot change, but the content can. This is one of the best features of Unity Pro.
  • 100,000 Dollar Turnover: This one isn't so much a feature as it is a guideline. According to Unity's End User License Agreement, the basic version of Unity cannot be licensed by any group or individual that made $100,000 in the previous fiscal year. This basically means, if you make a bunch of money, you have to buy Unity Pro. Of course, if you are making that much money, you can probably afford it without issue. That is the view of Unity at least, and the reason why it is there.
  • Mecanim: IK Rigs: Unity's new animation system, Mecanim, supports many exciting new features, one of which is IK. If you are unfamiliar with the term, IK allows one to define the target point of an animation and let the system figure out how to get there. Imagine you have a cup sitting on a table and a character that wants to pick it up. You could animate the character to bend over and pick it up, but what if the character is slightly to the side? Or any number of other slight offsets that a player could cause, completely throwing off your animation. It is simply impractical to animate for every possibility. With IK, it hardly matters that the character is slightly off. We just define the goal point for the hand and leave the arm to the IK system. It calculates for us how the arm needs to move in order to get the hand to the cup. Another fun use is making characters look at interesting things as they walk around a room. A guard could track the nearest person, the player character could look at things that they can interact with, or a tentacle monster could lash out at the player without all the complex animation. This will be an exciting one to play with.
  • Mecanim: Sync Layers & Additional Curves
    • Sync layers, inside Mecanim, allow us to keep multiple sets of animation states in time with each other. Say you have a soldier that you want to animate differently based on how much health he has. When at full health, he walks around briskly. After a little damage, it becomes more of a trudge. If health is below half, a limp is introduced to his walk. And when almost dead, he crawls along the ground. With sync layers, we can create one animation state machine and duplicate it to multiple layers. By changing the animations and syncing the layers, we can easily transition between the different animations while maintaining the state machine.
    • Additional curves are simply the ability to add curves to your animations. This means we can control various values with the animation. For example, in the game world, when a character picks up their feet for a jump, gravity will pull them down almost immediately. By adding an extra curve to that animation, in Unity, we can control how much gravity is affecting the character, allowing them to actually get in the air when jumping. This is a useful feature for controlling such values right alongside the animations, but one could just as easily create a script that holds and controls the curves.
  • Custom Splash Screen: Though pretty self-explanatory, it is perhaps not immediately evident why this feature is specified, unless you have worked with Unity before. When an application built in Unity initializes on any platform, it displays a splash screen. In Unity Basic this will always be the Unity logo. By purchasing Unity Pro, you can substitute the Unity logo with any image you want.
  • Build Size Stripping: This is an important feature for mobile platforms. Build size stripping removes all of the excess from your final build. Unity does a very good job at only including the assets that you have created that are used in the final build. With the stripping, it also only includes the parts of the engine itself that are used in the game. This is of great use when you absolutely have to get under that limit for downloading from the cell towers. On the other hand, you could create something similar to the asset bundles. Just let the users buy the framework, and download the assets later.
  • Realtime Directional Shadows: Lights and shadows add a lot to the mood of a scene. This feature allows us to go beyond blob shadows and use realistic looking shadows. This is all well and good if you have the processing space for it. Most mobile devices do not. This feature should also never be used for static scenery. Instead, use static lightmaps, which is what they are for. But if you can find a good balance between simple needs and quality, this could be the feature that creates the difference between an alright and an awesome game.
  • HDR, tone mapping: HDR (High Dynamic Range) and tone mapping allow us to create more realistic lighting effects. Standard rendering uses values from zero to one to represent how much of each color in a pixel is on. This does not allow for a full spectrum of lighting options to be explored. HDR lets the system use values beyond this range and process them using tone mapping to create better effects, such as a bright morning room or the bloom from a car window reflecting the sun. The downside of this feature is in the processor. The device can still only handle values between zero and one, so converting them takes time. Additionally, the more complex the effect, the more time it takes to render it. It would be surprising to see this used well on handheld devices, even in a simple game. Maybe the modern tablets could handle it.
  • Light Probes: Light probes are an interesting little feature. When placed in the world, light probes figure out how an object should be lit. Then, as a character walks around, they tell it how to be shaded. The character is, of course, lit by the lights in the scene but there are limits on how many lights can shade an object at once. Light probes do all the complex calculations beforehand, allowing for better shading at runtime. Again, however, there are concerns about the processing power. Too little and you won't get a good effect; too much and there will be no processing left for playing the game.
  • Lightmapping with Global Illumination and area lights: All versions of Unity support lightmaps, allowing for the baking of complex static shadows and lighting effects. With the addition of global illumination and area lights, you can add another touch of realism to your scenes. However, every version of Unity also lets you import your own lightmaps. This means, you could use some other program to render the lightmaps and import them separately.
  • Static Batching: This feature speeds up the rendering process. Instead of spending time on each frame grouping objects for faster rendering, this allows the system to save the groups generated beforehand. Reducing the number of draw calls is a powerful step towards making a game run faster. That is exactly what this feature does.
  • Render-to-Texture Effects: This is a fun feature, but of limited use. It simply allows you to redirect the rendering of the camera from going to the screen and instead go to a texture. This texture could then, in its most simple form, be put onto a mesh and act like a surveillance camera. You could also do some custom post processing, such as removing the color from the world as the player loses their health. However, that option could become very processor-intensive.
  • Full-Screen Post-Processing Effects: This is another processor-intensive feature that probably will not make it into your mobile game. But you can add some very cool effects to your scene. Such as, adding motion blur when the player is moving really fast, or a vortex effect to warp the scene as the ship passes through a warped section of space. One of the best is using the bloom effect to give things a neon-like glow.
  • Occlusion Culling: This is another great optimization feature. The standard camera system renders everything that is within the camera's view frustum, the view space. Occlusion culling lets us set up volumes in the space our camera can enter. These volumes are used to calculate what the camera can actually see from those locations. If there is a wall in the way, what is the point of rendering everything behind it? Occlusion culling calculates this and stops the camera from rendering anything behind that wall.
  • Navmesh: Dynamic Obstacles and Priority: This feature works in conjunction with the pathfinding system. In scripts, we can dynamically set obstacles, and characters will find their way around them. Being able to set priorities means different types of characters can take different types of objects into consideration when finding their way around. A soldier must go around the barricades to reach his target. The tank, however, could just crash through, should it desire to.
  • .Net Socket Support: This feature is only useful if you plan on doing fancy things over a user's network. Multiplayer networking is already supported in every version of Unity. The multiplayer that is available, though, does require a master server. With the use of sockets, one could create connections to other devices locally.
  • Profiler and GPU profiling: This is a very useful feature. The profiler provides tons of information about how much load your game puts on the processor. With this information we can get right down into the nitty-gritties and determine exactly how long a script takes to process. Towards the end of the book, though, we will also create a tool for determining how long specific parts of your code take to process.
  • Script Access to Asset Pipeline: This is an alright feature. With full access to the pipeline, there is a lot of custom processing that can be done on assets and builds. The full range of possibilities are beyond the scope of this book. But think of it as being able to tint all of the imported textures slightly blue.
  • Dark Skin: This is entirely a cosmetic feature. Its point and purpose are questionable. But if a smooth, dark-skinned look is what you desire, this is the feature you want. There is an option in the editor to change it to the color scheme used in Unity Basic. For this feature, whatever floats your boat goes.

Setting up the development environment

Before we can create the next great game for Android, we need to install a few programs. In order to make the Android SDK work, we will first install the JDK. Then, we will be installing the Android SDK. After that is the installation of Unity. We then have to install an optional code editor. To make sure everything is set up correctly, we will connect to our devices and take a look at some special strategies if the device is a tricky one. Finally, we will install Unity Remote, a program that will become invaluable in your mobile development.

Time for action – installing the JDK

Android's development language of choice is Java, so to develop for it we need a copy of the Java SE Development Kit, JDK, on our computers. The process of installing the JDK is given in the following steps:

  1. The latest version of the JDK can be downloaded from http://www.oracle.com/technetwork/java/javase/downloads/index.html. So, open the site in a web browser.
    Time for action – installing the JDK
  2. Select Java Platform (JDK) from the available versions and you will be brought to a combination of license agreement and type selection page.
  3. Accept the license agreement, and select your appropriate Windows version from the bottom of the list. If you are unsure which to choose, then Windows x86 is usually a safe choice.
  4. Once the download is completed, run the new installer.
  5. A scan, two Next button-clicks, an initialization, and one more Next button will install the JDK to the default location. It is as good there as anywhere else, so once it is done installing, hit Close.

What just happened?

We installed the JDK (Java Development Kit). We need this so that our Android development kit will work. Luckily, the installation process for this keystone is short and sweet.

Time for action – installing the Android SDK

In order to actually develop and connect to our devices, we need to have the Android SDK installed. Having it fulfills two primary requirements. First, it makes sure we have the bulk of the latest drivers for recognizing devices. Second, we are able to use the ADB (Android Debug Bridge). ADB is the system used for actually connecting to and interacting with the device. The process of installing the Android SDK is given in the following steps:

  1. The latest version of the Android SDK can be found at http://developer.android.com/sdk/index.html, so open a web browser and go to the given site.
  2. Once there, scroll to the bottom and select USE AN EXISTING IDE.
  3. Follow that up by clicking on the Download the SDK Tools for Windows button.
    Time for action – installing the Android SDK
  4. You will then be sent to a Terms and Conditions agreement. Read it if you prefer, but agree to it to continue and hit the download button to start downloading the installer.
  5. Once it has finished downloading, start it up.
  6. Hit the first Next button and the installer will try to find an appropriate version of the JDK. You will come to a page complaining about it, if you do not have it installed.
  7. If you skipped ahead and do not have the JDK installed, hit the Visit java.oracle.com button in the middle of the page and go back to the previous section for guidance on installing it. If you do have it, continue with the process.
  8. Hitting Next again will bring us to a page about selecting who to install the SDK for.
  9. Select Install for anyone using this computer, because the default install location is easier to get to for later purposes.
  10. Hit Next twice, followed by Install to install to the default location.
  11. Once it is done, hit Next and Finish to complete the installation of the Android SDK Manager.
  12. If the Android SDK Manager does not start right away, start it up. Either way, give it a moment to initialize. The SDK Manager makes sure that we have the latest drivers, systems, and tools for developing with the Android platform. But first, we have to actually install them.
    Time for action – installing the Android SDK
  13. By default it should select a number of options to install. If not, select the latest Android API, 4.3 (API 18) as of the time of writing this, Android Support Library and Google USB Driver found in Extras. Be absolutely sure that Android SDK Platform-tools is selected. This one will be very important later. It actually includes the tools we need to connect to our device.
  14. Once everything is selected, hit Install packages in the bottom-right corner.
  15. The next screen is another set of license agreements. Every time a component is installed or updated through the SDK Manager, you have to agree to the license terms before it gets installed. Accept all of the licenses and hit Install to start the process.
  16. You can now sit back and relax. It takes a while for the components to be downloaded and installed. Once it is all done, you can close it out. We have completed the process, but you should occasionally come back to it. Periodically checking the SDK Manager for updates will make sure you are using the latest tools and API's.

What just happened?

We installed the Android SDK. Without it, we would be completely unable to do anything with the Android platform. Besides the long wait to download and install components, this was a pretty easy installation.

Time for action – installing Unity 3D

Perhaps the most important part of this whole book, without which none of the rest has meaning, is installing Unity.

  1. The latest version of Unity can be found at http://www.unity3d.com/unity/download. As of the time of writing this, the current version is 4.2.2.
  2. Once downloaded, launch the installer and click Next until you reach the Choose Components page.
    Time for action – installing Unity 3D
  3. Here, we are able to select the features of Unity installation. None of these options are actually necessary for following the rest of this book, but they warrant having a look at since Unity will ask every time you update or reinstall it.
    • The Example Project is the current project built by Unity to show off some of its latest features. If you want to jump in early and take a look at what a complete Unity game looks like, leave this checked.
    • The Unity Development Web Player is required if you plan on developing browser applications with Unity. As this book is focused on Android development, it is entirely optional. It is, however, a good one to check. You never know when you may need a web demo and since it is entirely free to develop for the web using Unity, there is no harm in having it.
    • The last option is MonoDevelop. It is a wise choice to leave this option unchecked. There is more detail in the next section, but it will suffice for now to say that it just adds an extra program for script editing that is not nearly as useful as it should be.
  4. Once you have selected or deselected your desired options, hit Next. If you wish to follow the book exactly, we will be unchecking MonoDevelop and leaving the rest checked.
  5. Next is the install location. The default location works well, so hit Install and wait. This will take a couple of minutes, so sit back, relax, and enjoy your favorite beverage.
  6. Once the installation is complete, the option to run Unity will be displayed. Leave it checked and hit Finish. If you have never installed Unity before, you will be presented with a license activation page.
    Time for action – installing Unity 3D
  7. While Unity does provide a feature–rich, free version, in order to follow the entirety of this book, one requires to make use of some of the Unity Pro features. At https://store.unity3d.com you have the ability to buy a variety of licenses. To follow the whole book, you will at least need to purchase Unity Pro and Android Pro licenses. Once purchased, you will receive an e-mail containing your new license key. Enter that in the provided text field.
  8. If you are not ready to make a purchase, you have two alternatives. We will go over how to reset your license in the Building a simple application section later in the chapter.
    • The first alternative is that you can check the Activate the free version of Unity checkbox. This will allow you to use the free version of Unity. As discussed earlier, there are many reasons to choose this option. The most notable at the moment is cost.
    • Alternatively, you can select the Activate a free 30-day trial of Unity Pro option. Unity offers a fully functioning, one-time installation, and free 30-day trial of Unity Pro. This trial also includes the Android Pro add-on. Anything produced during those 30 days is completely yours, just as if you had purchased a full Unity Pro license. They want you to see how great it is, so you will come back and make a purchase. The downside is the Trial Version watermark that will be constantly displayed in the corner of the game. After the 30 days, Unity will revert to the free version. This is a great option, should you choose to wait before making a purchase.
  9. Whatever your choice is, hit OK once you have made it.
  10. The next page simply asks you to log in with your Unity account. This will be the same account you used to make your purchase. Just fill out the fields and hit OK.
  11. If you have not yet made a purchase, you can hit Create Account and have it ready to go when you do make a purchase.
  12. The next page is a short survey on your development interests. Fill it out and hit OK or scroll straight to the bottom and hit Not right now.
  13. Finally there is a thank you page. Hit Start using Unity.
  14. After a short initialization, the project wizard will open and we can start creating the next great game. However, there is still a bunch of work to do: in connecting the development device. So, for now, hit the X button in the top-right corner to close the project wizard. We will cover how to create a new project in the Building a simple application section later on.

What just happened?

We just installed Unity 3D. The whole book relies on this step. We also had to make a choice about licenses. If you chose to purchase the Pro version, you will be able to follow everything in this book without issues. The alternatives, though, will have a few shortcomings. You will either not have full access to all of the features or be limited to the length of the trial.

Optional code editor

Now a choice has to be made about code editors. Unity comes with a system called MonoDevelop. It is similar in many respects to Visual Studio. And, like Visual Studio, it adds many extra files and much girth to a project, all of which it needs to operate. All this extra girth makes it take an annoying amount of time while it starts up, before one can actually get to the code.

Technically, you can get away with a plain text editor as Unity doesn't really care. This book recommends using Notepad++, found at http://notepad-plus-plus.org/download. Free to use, it is essentially Notepad with code highlighting. There are several fancy widgets and add-ons for Notepad++ that add even greater functionality, but they are not necessary for following this book. If you choose this alternative, installing Notepad++ to the default location will work just fine.

Connecting to a device

Perhaps the most annoying step in working with Android devices is setting up the connection to your computer. Because there are so many different kinds of devices, it can get a little tricky at times just to have the device recognized by your computer.

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.

Time for action – connecting trickier devices

For trickier devices, there are a few general things we can try. If these steps fail to connect your device, you may need to do some special research.

  1. Start by typing the following commands. These will restart the connection system and display the list of devices again.
    adb kill-server
    adb start-server
    adb devices
    
  2. If you are still not having any luck, try the following commands. These commands force an update and restart the connection system.
    cd ../tools
    android update adb
    cd ../platform-tools
    adb kill-server
    adb start-server
    adb devices
    
  3. If your device is still not showing up, you have one of the most annoying and tricky devices. Check the manufacturer's website for data syncing and management programs. If you have had your device for quite some time, you have probably been prompted to install this more than once. If you have not already done so, install the latest version, even if you never plan on using it. The point is to obtain the latest drivers for your device, and this is the easiest way.
  4. Restart the connection system again using the first set of commands, and cross your fingers.
  5. If you are still unable to connect, the best, professional recommendation that can be made is to Google it. Conducting a search for your device brand with adb at the end should turn up a step-by-step tutorial specific to your device in the first couple of results. http://www.xda-developers.com/ is also an excellent resource for finding out all about the nitty-gritties of Android devices.

What just happened?

Some of the devices that you will encounter while developing will not connect easily. We just covered some quick steps and managed to connect these devices. If we could have covered the processes for every device, we would have. However, the variety of devices is just too large, and they keep making more.

Unity Remote

Unity Remote is a great application created by the Unity team. It allows developers to connect their Android powered devices to the Unity Editor and provide mobile inputs for testing. This is a definite must for any aspiring Unity and Android developer. If you are using a non-Amazon device, acquiring Unity Remote is quite easy. At the time of writing this book, it could be found on Google Play at https://play.google.com/store/apps/details?id=com.unity3d.androidremote. It is free and does nothing but connect to the Unity Editor, so the permissions are negligible.

If, however, you are like the ever-growing Amazon market or seek to target Amazon's line of Android devices, adding Unity Remote becomes a little trickier. First, you need to download the APK. It can be found at: http://files.unity3d.com/ricardo/AndroidRemote.apk. Be sure to download the file to a location that you can easily get the whole file path for. In the next section, we build a simple application and put it on our device. Follow along from the Start Console step, replacing the simple application with the downloaded APK.

Building a simple application

We are now going to create a simple Hello World application. This will familiarize you with the Unity interface and how to actually put an application on your device.

Time for action – Hello World

To make sure everything is set up properly, we need a simple application to test with, and what better to do that with than a Hello World application?

  1. The first step is pretty straightforward and simple; start Unity.
  2. If you have been following along so far, once it is done you should see a screen resembling the next screenshot. As the tab might suggest, this is the screen through which we open our various projects. Right now, though, we are interested in creating one, so select Create New Project from the second tab on top, and we will do just that.
    Time for action – Hello World
  3. Use the Browse button to select an empty folder to keep your project in. Be sure that the folder is empty, because Unity will delete everything in it before creating the new project. Ch1_HelloWorld_CS works well for a project name.
    Time for action – Hello World
  4. For now we can ignore the packages. These are bits of assets and functionality provided by Unity. They are free for you to use in your projects.
  5. Hit the Create button, and Unity will create a brand new project for us.
    Time for action – Hello World
  6. The default layout of Unity contains a decent spread of windows needed to create a game.
    • Starting from the left-hand side, Hierarchy contains a list of all the objects that currently exist in our scene. They are organized alphabetically and are grouped under parent objects, if any.
    • Next to that is the Scene view. This window allows us to edit and arrange objects in the 3D space. In the top-left hand side, there are two groups of buttons. These affect how you can interact with the Scene view.
    • The button on the far left that looks like a hand lets you pan around when clicking and dragging with the left-mouse button.
    • The next button over, the crossed arrows, lets you move objects around. Its behavior and the gizmo it provides will be familiar if you have made use of any modeling programs.
    • The third button changes the gizmo to rotation. It allows you to rotate objects.
    • The fourth button is for scale. It changes the gizmo as well.
    • The second to last button toggles between Pivot and Center. This will change the position of the gizmo used by the last three buttons to be either at the pivot point of the selected object, or at the average position point of all the selected objects.
    • The last button toggles between Local and Center. This changes whether the gizmo is orientated parallel with the world origin or rotated with the selected object.
    • Underneath the Scene view is the Game view. This is what is currently being rendered by any cameras in the scene. It is what the player will see when playing the game and is used for testing your game. There are three buttons that control the playback of the Game view in the upper-middle section of the window.
    • The first is the Play button. It toggles the playing of the game. If you want to test your game, press this button.
    • The second is the Pause button. While playing, pressing this button will pause the whole game, allowing you to take a look at the game's current state.
    • The third is the Step button. When paused, this button will let you progress through your game one frame at a time.
    • On the right-hand side is the Inspector window. This displays information about any object that is currently selected.
    • In the bottom left-hand side is the Project window. This displays all of the assets that are currently stored in the project.
    • Behind it is the Console. It will display debug messages and compile errors, warnings, and runtime errors.
  7. At the top, underneath Help is an option called Manage License.... By selecting this, we are given options to control the license. The button descriptions cover what they do pretty well, so we will not cover them in more detail at this point.
  8. The next thing we need to do is connect our optional code editor. At the top, go to Edit followed by Preferences..., which opens the following window:
    Time for action – Hello World
  9. By selecting External Tools on the left, we can select other software to be used for managing asset editing.
  10. If you do not desire to use MonoDevelop, select the drop-down list to the right of External Script Editor and navigate to the executable of Notepad++, or the other code editor of your choice.
  11. Your Image application can also be changed here to Adobe Photoshop CS3 or any other image-editing program you prefer, in the same way as the script editor.
  12. If you installed the Android SDK to the default location, do not worry about it. Otherwise, click on Browse... and find the android-sdk folder.
  13. Now, for the actual creation of this application, right-click inside of your Project window.
  14. From the new window that pops up, select Create and C# Script from the menu.
  15. Type in a name for the new script, HelloWorld will work well, and hit Enter twice: once to confirm the name and once to open it.

    Tip

    Because this is the first chapter, it will be a simple Hello World application. Unity supports C#, JavaScript, and Boo as scripting languages. For consistency, this book will be using C#. If you, instead, wish to use JavaScript for your scripts, copies of all of the projects can be found with the other resources for this book and an _JS suffix for JavaScript.

  16. Every script that is going to attach to an object inherits from MonoBehaviour. JavaScript does this automatically, but C# scripts must define it explicitly. However, as you can see from the default code in the script, we do not have to worry about setting this up initially; it is done automatically. Inheriting from MonoBehaviour lets our scripts access various values of the game object, such as the position, and lets the system automatically call certain functions during specific events in the game, such as the Update cycle and the GUI rendering.
  17. For now we will delete the Start and Update functions that Unity insists on including in every new script. Replace them with a bit of code that simply renders the words Hello World in the top-left corner of the screen. You can now close the script and return to Unity.
    public void OnGUI() {
      GUILayout.Label("Hello World");
    }
  18. Drag the HelloWorld script from the Project window and drop it on the Main Camera object in the Hierarchy window. Congratulations, you have just added your first bit of functionality to an object in Unity.
  19. If you select the Main Camera in Hierarchy, then Inspector will display all of the components attached to it. At the bottom of the list is your brand new HelloWorld script.
  20. Before we can test it, we need to save the scene. To do this, go to File at the top, and select Save Scene. Give it a name of HelloWorld and hit Save.
  21. You are now free to hit the Play button in the upper-middle section of the editor and witness the magic of Hello World.
  22. We now get to build the application. At the top, select File followed by Build Settings....
  23. By default the target platform is PC. Under Platform, select Android and hit Switch Platform in the bottom-left corner of the Build Settings window.
  24. Underneath the Scenes In Build box, there is a button labeled Add Current. Click on it to add our currently opened scene to the build. Only scenes that are in this list and checked will be added to the final build of your game. The scene with the number zero next to it will be the first scene loaded when the game starts.
  25. There is one last thing to change before we can hit the Build button. Select Player Settings... at the bottom of the Build Settings window.
  26. The Inspector window will open Player Settings for the application. From here we can change the splash screen, icon, screen orientation, and a handful of other technical options.
    Time for action – Hello World
  27. At the moment, there are only a few options that we care about. At the top, Company Name is the name that will appear under the information about the application. Product Name is the name that will appear underneath the icon on your Android device. You can largely set these to anything you want, but they do need to be set immediately.
    Time for action – Hello World
  28. The important setting is Bundle Identifier underneath Other Settings. This is the unique identifier that singles out your application from all other applications on the device. The format is com.CompanyName.ProductName, and it is good practice to use the same company name across all of your products. For this book, we will be using com.TomPacktAndBegin.Ch1.HelloWorld for Bundle Identifier, opting to use an extra dot for organization.
  29. Go up to File and click on Save again.
  30. Now you can hit the Build button in the Build Settings window.
  31. Pick a save location and a file name; Ch1_HelloWorld.apk works well. Be sure to remember where it is, and hit Save.
  32. If, during the build process, Unity complains about where the Android SDK is, select the android-sdk folder inside the location where it was installed. The default would be C:\Program Files\Android\android-sdk for 32-bit Windows and C:\Program Files (x86)\Android\android-sdk for 64-bit Windows.
  33. Once the loading bar finishes, which should not be very long, your apk has been made and we are ready to continue.
  34. We are finished with Unity for this chapter. You can close it down and start a command prompt.
  35. Just as we did when we were connecting our devices, we need to navigate to the platform tools folder in order to connect to our device. If you installed it to the default location, use:
    1. For 32-bit Windows:
      cd c:\program files\android\android-sdk\platform-tools
      
    2. For 64-bit Windows:
      cd c:\program files (x86)\android\android-sdk\platform-tools
      
  36. Double-check to make sure that the device is connected and recognized using:
    adb devices
    
  37. Now we install the application. This command tells the system to install an application on the connected device. The -r indicates that it should override if an application is found with the same Bundle Identifier as the application we are trying to install. That way you can just update your game as you develop, rather than uninstalling before installing the new version each time you need to make an update. The path to the .apk file that you wish to install is shown in quotes as follows:
    adb install -r "c:\users\tom\desktop\packt\book\ch1_helloworld.apk"
    
  38. Replace it with the path to your apk file; capital letters do not matter, but be sure to have all the correct spacing and punctuations.
  39. If all goes well, the console will display an upload speed when it has finished pushing your application to the device and a success message when it is finished installing. The most common causes for errors at this stage are not being in the platform-tools folder when issuing commands and not having the correct path to your .apk file surrounded by quotes.
  40. Once you have received your success message, find the application on your phone and start it up.
  41. Now, gaze in wonder at your ability to create Android applications with the power of Unity.

What just happened?

We created our very first Unity and Android application. Admittedly, it was just a simple Hello World application, but that is how it always starts. Also, it served very well for double-checking the device connection and for learning about the build process without all of the clutter from a game.

Have a go hero – working ahead

Try changing the icon for the application. It is a fairly simple procedure that you will undoubtedly want to perform as your game develops. How to do this was mentioned earlier in this section. But, as a reminder, take a look at Player Settings. Also, you will need to import an image. Take a look under Assets, in the menu bar, to know how to do this.

Summary

There were a lot of technical things in this chapter. First, we discussed the benefits and possibilities when using Unity and Android. That was followed by a whole lot of installation; the JDK, the Android SDK, Unity 3D, and Unity Remote. We then figured out how to connect to our devices through the command prompt. Our first application was quick and simple to make. Finally, we built it and put it on a device.

The next chapter will see us creating a game that is significantly more interactive, Tic-tac-toe. We will be exploring the wonderful world of graphical user interfaces. So, not only will we make the game, but we will make it look good too.

Left arrow icon Right arrow icon

Key benefits

  • Enter the increasingly popular mobile market and create games using Unity 3D and Android
  • Learn optimization techniques for efficient mobile games
  • Clear, step-by-step instructions for creating a complete mobile game experience

Description

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.

Who is this book for?

Great for developers new to Unity, Android, or both, this book will walk you through everything you need to know about game development for the Android mobile platform. No experience with programming, Android, or Unity is required. Most of the assets used in each chapter project are provided with the book, but it is assumed that you have some access to basic image and model creation software. You will also need access to an Android powered device.

What you will learn

  • Set up a development environment to work with both Unity and Android
  • Import and work with the basic building blocks of a game: meshes, materials, and animations
  • Utilize particles and sound effects to provide feedback to the player
  • Adjust camera effects and game logic to create 2D games
  • Interface with touch and tilt inputs to create custom control systems
  • Set up path finding to create intelligently moving characters
  • Successfully create custom graphical interfaces
  • Set up and utilize physics to create a mobile game classic
  • Create dynamically lit scenes using lightmaps
  • Understand the best choices for optimizing a game for the mobile platform
Estimated delivery fee Deliver to Luxembourg

Premium delivery 7 - 10 business days

€17.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Dec 23, 2013
Length: 320 pages
Edition : 1st
Language : English
ISBN-13 : 9781849692014
Vendor :
Unity Technologies
Languages :
Tools :

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to Luxembourg

Premium delivery 7 - 10 business days

€17.95
(Includes tracking information)

Product Details

Publication date : Dec 23, 2013
Length: 320 pages
Edition : 1st
Language : English
ISBN-13 : 9781849692014
Vendor :
Unity Technologies
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 111.97
Unity 4.x Game Development by Example: Beginner's Guide
€37.99
Unity Android Game Development by Example Beginner's Guide
€36.99
Unity Multiplayer Games
€36.99
Total 111.97 Stars icon
Banner background image

Table of Contents

11 Chapters
1. Saying Hello to Unity and Android Chevron down icon Chevron up icon
2. Looking Good – Graphical Interface Chevron down icon Chevron up icon
3. The Backbone of Any Game – Meshes, Materials, and Animations Chevron down icon Chevron up icon
4. Setting the Stage – Camera Effects and Lighting Chevron down icon Chevron up icon
5. Getting Around – Pathfinding and AI Chevron down icon Chevron up icon
6. Specialties of the Mobile Device – Touch and Tilt Chevron down icon Chevron up icon
7. Throwing Your Weight Around – Physics and a 2D Camera Chevron down icon Chevron up icon
8. Special Effects – Sound and Particles Chevron down icon Chevron up icon
9. Optimization Chevron down icon Chevron up icon
A. Pop Quiz Answers Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.9
(15 Ratings)
5 star 46.7%
4 star 26.7%
3 star 6.7%
2 star 6.7%
1 star 13.3%
Filter icon Filter
Top Reviews

Filter reviews by




Belinda Feb 23, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Unity Android Game Development by Example Beginner’s Guide by Thomas Finnegan is a comprehensive introduction to Unity Development in general and Android development specifically. I would not recommend it to an unexperienced first-time game developer, but with only some basic experience Finnegan’s set of four tutorial games are a great read with plenty of useful information about all aspects of Unity Android development, including 2D and 3D games.The book covers scripting in the C# language and does a decent job at explaining the logic of most written code. Each exemplar game introduces new concepts and the difficulty curve slowly and consistently climbs until the last chapter gives valuable insights into game optimization. Some discussed features require a Unity Pro license to get maximum value out of the book. Despite sometimes almost reading like a Unity ad, I can recommend this book, as it currently is the most comprehensive and up-to-date introduction to Unity Android development.
Amazon Verified review Amazon
Oleg Apr 10, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Great book, very easy to follow, almost no typos or errors!Sometimes quite complex scripting but not too complex though.Very interesting games & lots of tips for mobile development.I highly recommend it!
Amazon Verified review Amazon
Geoffrey Hill Jan 28, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Packt publishing have been on a bit of a roll lately with the Unity books. I got this and the playmaker book for some holidays study type fun.This was by far the best.3 large detailed examples to work through, really impressed by the content detail and layout. There are some poorly explained game logic sections but since that's not the focus of the book I easily forgive it. (a couple of very clever blocks of code that do in 2 lines what I would have done in 20, my c# skills are pretty beginner)Highly recommended if you're interested in using unity to develop for android.Just make sure you have spent a little time with C# first. =)
Amazon Verified review Amazon
Thom Feb 04, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book is not merely dry, instructive details but good 'hands-on' construction of some real-world games. Additionally, there are ample screenshots to help guide and verify that you are progressing correctly on each step.As an instructor of software programming I truly appreciate the very methodical and progressive approach this book takes. With each chapter you build, gradually, on information (and hands-on illustrations) from previous chapters.Although I have experience with Unity3D, I have never explored development for the Android platform. Additionally, there are aspects of the Unity3D platform that I was not aware prior to reading this book!This book contains very thorough and clear explanation of the specifics to Mobile (Touch, Tilt). No other books I have seen on this subject has given this much attention to that.After completing this book you will not only have a very strong knowledge and understanding of Unity3D development for the Android platform, but also the foundation of a several fun games on which to build and grow your expertise.
Amazon Verified review Amazon
Dimitris-Ilias Gkanatsios Jun 27, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Loved that book, great samples, some advanced stuff. Content applies to almost all mobile platforms. Highly recommended for novice to intermediate Unity users.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela