Unity 2020 Mobile Game Development
eBook - ePub

Unity 2020 Mobile Game Development

Discover practical techniques and examples to create and deliver engaging games for Android and iOS, 2nd Edition

John P. Doran

Partager le livre
  1. 464 pages
  2. English
  3. ePUB (adapté aux mobiles)
  4. Disponible sur iOS et Android
eBook - ePub

Unity 2020 Mobile Game Development

Discover practical techniques and examples to create and deliver engaging games for Android and iOS, 2nd Edition

John P. Doran

DĂ©tails du livre
Aperçu du livre
Table des matiĂšres
Citations

À propos de ce livre

A practical guide on how to use Unity for building cross-platform mobile games and Augmented Reality apps using the latest Unity 2020 toolset

Key Features

  • Create, deploy, and monetize captivating and immersive games on Android and iOS platforms
  • Take your games into the real world by adding augmented reality features to your mobile projects
  • Kick-start your mobile game development journey with step-by-step instructions and a demo game project

Book Description

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.

What you will learn

  • Design responsive user interfaces for your mobile games
  • Detect collisions, receive user input, and create player movements for your mobile games
  • Create interesting gameplay elements using inputs from your mobile device
  • Explore the mobile notification package in Unity game engine to keep players engaged
  • Create interactive and visually appealing content for Android and iOS devices
  • Monetize your game projects using Unity Ads and in-app purchases

Who this book is for

If you are a game developer or mobile developer who wants to learn Unity and use it to build mobile games for iOS and Android, then this Unity book is for you. Prior knowledge of C# and Unity will be beneficial but is not mandatory.

Foire aux questions

Comment puis-je résilier mon abonnement ?
Il vous suffit de vous rendre dans la section compte dans paramĂštres et de cliquer sur « RĂ©silier l’abonnement ». C’est aussi simple que cela ! Une fois que vous aurez rĂ©siliĂ© votre abonnement, il restera actif pour le reste de la pĂ©riode pour laquelle vous avez payĂ©. DĂ©couvrez-en plus ici.
Puis-je / comment puis-je télécharger des livres ?
Pour le moment, tous nos livres en format ePub adaptĂ©s aux mobiles peuvent ĂȘtre tĂ©lĂ©chargĂ©s via l’application. La plupart de nos PDF sont Ă©galement disponibles en tĂ©lĂ©chargement et les autres seront tĂ©lĂ©chargeables trĂšs prochainement. DĂ©couvrez-en plus ici.
Quelle est la différence entre les formules tarifaires ?
Les deux abonnements vous donnent un accĂšs complet Ă  la bibliothĂšque et Ă  toutes les fonctionnalitĂ©s de Perlego. Les seules diffĂ©rences sont les tarifs ainsi que la pĂ©riode d’abonnement : avec l’abonnement annuel, vous Ă©conomiserez environ 30 % par rapport Ă  12 mois d’abonnement mensuel.
Qu’est-ce que Perlego ?
Nous sommes un service d’abonnement Ă  des ouvrages universitaires en ligne, oĂč vous pouvez accĂ©der Ă  toute une bibliothĂšque pour un prix infĂ©rieur Ă  celui d’un seul livre par mois. Avec plus d’un million de livres sur plus de 1 000 sujets, nous avons ce qu’il vous faut ! DĂ©couvrez-en plus ici.
Prenez-vous en charge la synthÚse vocale ?
Recherchez le symbole Écouter sur votre prochain livre pour voir si vous pouvez l’écouter. L’outil Écouter lit le texte Ă  haute voix pour vous, en surlignant le passage qui est en cours de lecture. Vous pouvez le mettre sur pause, l’accĂ©lĂ©rer ou le ralentir. DĂ©couvrez-en plus ici.
Est-ce que Unity 2020 Mobile Game Development est un PDF/ePUB en ligne ?
Oui, vous pouvez accĂ©der Ă  Unity 2020 Mobile Game Development par John P. Doran en format PDF et/ou ePUB ainsi qu’à d’autres livres populaires dans Computer Science et Programming Games. Nous disposons de plus d’un million d’ouvrages Ă  dĂ©couvrir dans notre catalogue.

Informations

Année
2020
ISBN
9781838980993
Édition
2
Resolution-Independent UI
When working on mobile devices, one of the things that you'll need to spend a fair bit of time on is the User Interface (UI). Unlike when developing projects for PC, where you only need to care about a single resolution or aspect ratio, there are many different devices out there with different resolutions and aspect ratios when building for mobile. For instance, we have phones, which fit in our pocket, but also tablets, which are huge. Not only that, but mobile games can also be played horizontally or vertically.
A Graphical User Interface (GUI) is the way that players interact with your games. You've actually been using a GUI in all of the previous chapters (the Unity Editor) and also when interacting with your operating system. Without a GUI of some sort, the only way you'd be able to interact with a computer is a command prompt, such as DOS or UNIX.
When working on GUIs, we want them to be as intuitive as possible and to only contain information that is pertinent to the player at any given time. There are people whose main job is programming and/or designing UIs, and there are college degrees on the subject as well. So, while we won't talk about everything to do with using GUIs, I do want to touch on the aspects that should be quite helpful when working on your own projects in the future.
When building for mobile, it's very important that you design your UI to be resolution-independent—that is, to ensure that the UI will scale and adjust itself to fit any screen size that is given to it. This will not only help us now but also in the future.
In this chapter, we will build the UI for our game, starting with a title screen, and then build the other menus that we will want to use for future chapters. This chapter will be split into a number of topics. The chapter is a simple step-by-step process from beginning to end. The following is the outline of our tasks:
  • Creating a title screen
  • Adding UI elements to the screen
  • Implementing a pause menu
  • Pausing the game
  • Adapting GUIs for notch devices

Technical requirements

This book utilizes Unity 2020.1.0f1 and Unity Hub 2.3.1, but the steps should work with minimal changes in future versions of the editor. If you would like to download the exact version used in this book, and there is a new version out, you can visit Unity's download archive at https://unity3d.com/get-unity/download/archive. You can also find the system requirements for Unity at https://docs.unity3d.com/2020.1/Documentation/Manual/system-requirements.html in the Unity Editor system requirements section. You can find the code files present in this chapter on GitHub at https://github.com/PacktPublishing/Unity-2020-Mobile-Game-Development-Second-Edition/tree/master/Chapter%2004.

Creating a title screen

Now, before we start adding UI elements to our game, let's first set up some groundwork and foundational knowledge by creating something that we will need anyway—a title screen:
  1. To start, we'll go ahead and create a new scene for us to work with by going to File | New Scene. When dealing with a UI, we will often want to see a visual representation of what will be drawn on the screen, so we will want to make use of 2D mode to have a better representation of what our UI will look like in the final version of the game.
  2. To do that, go to the Scene view tab—you'll see the control bar menu with a 2D button on it underneath that. Click on it, and you should see the camera automatically move into something that looks similar to the following screenshot:
The 2D button switches the camera between 2D and 3D views. In 2D mode, you'll note that the Scene Gizmos is gone due to the fact that the only option is to look perpendicularly at the XY plane (the x axis pointing to the right and the y axis pointing upward) and that our camera has changed to an orthographic view.
  1. We have to create a Text object with the name of our game. Go to the menu and select GameObject | UI | Text.
Note that while this book is using the included-by-default Unity UI system and Text objects, the following steps also work with TextMesh Pro objects and all of the concepts in this chapter work the same with both systems. If you are interested in using TextMesh Pro with your project, you can find more information on the additional steps required to import and utilize it in your project: https://learn.unity.com/tutorial/quickstart-to-textmesh-pro-2019-3.
  1. This will create three new objects, as you can see in the Hierarchy view:
    • Canvas: This is the area where all of the UI elements will reside, and if you try to create a UI element without one already existing, Unity will create one for you like it just did here. From the Scene view tab, it will draw a white rectangle around itself to show you how large it is and will resize itself depending on how large the Game view is:
  2. ...

Table des matiĂšres