Book Image

Unity 2017 Mobile Game Development

By : John P. Doran
Book Image

Unity 2017 Mobile Game Development

By: John P. Doran

Overview of this book

Unity has established itself as an overpowering force for developing mobile games. If you love mobile games and want to learn how to make them but have no idea where to begin, then this book is just what you need. This book takes a clear, step-by-step approach to building an endless runner game using Unity with plenty of examples on how to create a game that is uniquely your own. Starting from scratch, you will build, set up, and deploy a simple game to a mobile device. You will learn to add touch gestures and design UI elements that can be used in both landscape and portrait mode at different resolutions. You will explore the best ways to monetize your game projects using Unity Ads and in-app purchases before you share your game information on social networks. Next, using Unity’s analytics tools you will be able to make your game better by gaining insights into how players like and use your game. Finally, you’ll learn how to publish your game on the iOS and Android App Stores for the world to see and play along.
Table of Contents (11 chapters)

Creating our first purchase

To make our first in-app purchase, we will make use of a feature of Unity that was just added to our project, Codeless IAP. It is called Codeless IAP because you do not need to write any code for the actual IAP transaction, just the script that defines what users get if they make the purchase. It's by far the easiest way to integrate in-app purchases in Unity games and a great way to start trying IAPs in our project.

One of the most common in-app purchases is the ability to disable advertisements in mobile games. Let's add that functionality now by creating a button that when clicked will do just that:

  1. Let's first open up our Main Menu level by going to the Project window, opening the Assets/Scenes folder, and then double-clicking on the MainMenu file.
  2. From there, let's click on the 2D button to go into 2D mode since we'll...