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

Condividi libro
  1. 464 pagine
  2. English
  3. ePUB (disponibile sull'app)
  4. Disponibile su iOS e 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

Dettagli del libro
Anteprima del libro
Indice dei contenuti
Citazioni

Informazioni sul libro

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.

Domande frequenti

Come faccio ad annullare l'abbonamento?
È semplicissimo: basta accedere alla sezione Account nelle Impostazioni e cliccare su "Annulla abbonamento". Dopo la cancellazione, l'abbonamento rimarrà attivo per il periodo rimanente già pagato. Per maggiori informazioni, clicca qui
È possibile scaricare libri? Se sì, come?
Al momento è possibile scaricare tramite l'app tutti i nostri libri ePub mobile-friendly. Anche la maggior parte dei nostri PDF è scaricabile e stiamo lavorando per rendere disponibile quanto prima il download di tutti gli altri file. Per maggiori informazioni, clicca qui
Che differenza c'è tra i piani?
Entrambi i piani ti danno accesso illimitato alla libreria e a tutte le funzionalità di Perlego. Le uniche differenze sono il prezzo e il periodo di abbonamento: con il piano annuale risparmierai circa il 30% rispetto a 12 rate con quello mensile.
Cos'è Perlego?
Perlego è un servizio di abbonamento a testi accademici, che ti permette di accedere a un'intera libreria online a un prezzo inferiore rispetto a quello che pagheresti per acquistare un singolo libro al mese. Con oltre 1 milione di testi suddivisi in più di 1.000 categorie, troverai sicuramente ciò che fa per te! Per maggiori informazioni, clicca qui.
Perlego supporta la sintesi vocale?
Cerca l'icona Sintesi vocale nel prossimo libro che leggerai per verificare se è possibile riprodurre l'audio. Questo strumento permette di leggere il testo a voce alta, evidenziandolo man mano che la lettura procede. Puoi aumentare o diminuire la velocità della sintesi vocale, oppure sospendere la riproduzione. Per maggiori informazioni, clicca qui.
Unity 2020 Mobile Game Development è disponibile online in formato PDF/ePub?
Sì, puoi accedere a Unity 2020 Mobile Game Development di John P. Doran in formato PDF e/o ePub, così come ad altri libri molto apprezzati nelle sezioni relative a Computer Science e Programming Games. Scopri oltre 1 milione di libri disponibili nel nostro catalogo.

Informazioni

Anno
2020
ISBN
9781838980993
Edizione
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. ...

Indice dei contenuti