Book Image

Unity 2020 Mobile Game Development - Second Edition

By : John P. Doran
Book Image

Unity 2020 Mobile Game Development - Second Edition

By: John P. Doran

Overview of this book

Unity 2020 brings a lot of new features that can be harnessed for building powerful games for popular mobile platforms. This updated second edition delves into Unity development, covering the new features of Unity, modern development practices, and augmented reality (AR) for creating an immersive mobile experience. The book takes a step-by-step approach to building an endless runner game using Unity to help you learn the concepts of mobile game development. This new edition also covers AR features and explains how to implement them using ARCore and ARKit with Unity. The book explores the new mobile notification package and helps you add notifications for your games. You’ll learn how to add touch gestures and design UI elements that can be used in both landscape and portrait modes at different resolutions. The book then covers the best ways to monetize your games using Unity Ads and in-app purchases before you learn how to integrate your game with various social networks. Next, using Unity’s analytics tools, you’ll enhance your game by gaining insights into how players like and use your game. Finally, you’ll take your games into the real world by implementing AR capabilities and publishing them on both Android and iOS app stores. By the end of this book, you will have learned Unity tools and techniques and be able to use them to build robust cross-platform mobile games.
Table of Contents (14 chapters)

An introduction to build settings

There are times during development when you may want to see what your game looks like outside of the editor. It can give you a sense of accomplishment; I know, I felt that way the first time I pushed a build to a console devkit. Whether it's for PC, Mac, Linux, web player, mobile, or console, we have to go through the same menu – the Build Settings menu:

  1. Start off by opening up the project that we created in Chapter 1, Building Your Game. In addition, open the Scene we created (SampleScene.unity, which is inside the Scenes folder):
  1. Since the Scene is our gameplay, let's rename the file by right-clicking on the object in the Project window and selecting Rename. Rename the file Gameplay. Unity will ask whether you want to reload the Scene. Do so by clicking Reload.
  1. From here, we will open the Build Settings menu by selecting File | Build Settings:
You may alternatively press Ctrl + Shift + B or command + Shift + B to bring the menu up as well.

In the preceding screenshot, you will notice that the Build Settings menu came up. This menu contains three sections:

    • Scenes in Build: This window contains the scenes in our project that we want to include when we build our project. This ensures that things such as test levels won't be included unless you specify so.
    • Platform: This is a list of all of the platforms that you can export your game to. The Unity logo shows up on the current platform you're compiling for. In order to change your platform, you'll need to select it from this list and then click on the Switch Platform button, which appears below the list.
    • Options: To the right of the Platform section, you'll see some settings that can be tweaked based on how you want the build to work, with certain options that change based on the platform you will work with.
  1. By default, we have no scenes in our build, so let's go ahead and change that. Click on the Add Open Scenes button; you should see the Gameplay level appear in the list at index 0, which means that when your game is played, this level will be the first one to load:
You may also add scenes to the Scenes in Build section by dragging and dropping them from the Project window. You may also drag the scenes to reorder them however you wish.

Now that we know how the build settings work, let's see how to build the project for PC to understand the general case before continuing to build our mobile game.