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)

Working with buttons

Now that we have the text displaying correctly, let's add the ability to move from the main menu into the game properly. However, unlike our title, for things that we want our players to touch, it's a good idea to make these buttons the same size in each device, as our fingers are the same size, no matter what device we are using. To show a possible solution for this, we will create a new Canvas using a different scaling technique.

  1. We will first rename our current Canvas object to Canvas - Scale Screen. This way, we can easily tell whether we are using the correct canvas for this or not.
  1. Now that we have that one ready, we can create our new one. Go to the top menu bar and then select GameObject | UI | Canvas. Rename this new Canvas to Canvas - Scale Physical. Then, under the Canvas Scaler component, change UI Scale Mode to Constant Physical Size...