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

Buch teilen
  1. 464 Seiten
  2. English
  3. ePUB (handyfreundlich)
  4. Über iOS und Android verfügbar
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

Angaben zum Buch
Buchvorschau
Inhaltsverzeichnis
Quellenangaben

Über dieses Buch

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.

Häufig gestellte Fragen

Wie kann ich mein Abo kündigen?
Gehe einfach zum Kontobereich in den Einstellungen und klicke auf „Abo kündigen“ – ganz einfach. Nachdem du gekündigt hast, bleibt deine Mitgliedschaft für den verbleibenden Abozeitraum, den du bereits bezahlt hast, aktiv. Mehr Informationen hier.
(Wie) Kann ich Bücher herunterladen?
Derzeit stehen all unsere auf Mobilgeräte reagierenden ePub-Bücher zum Download über die App zur Verfügung. Die meisten unserer PDFs stehen ebenfalls zum Download bereit; wir arbeiten daran, auch die übrigen PDFs zum Download anzubieten, bei denen dies aktuell noch nicht möglich ist. Weitere Informationen hier.
Welcher Unterschied besteht bei den Preisen zwischen den Aboplänen?
Mit beiden Aboplänen erhältst du vollen Zugang zur Bibliothek und allen Funktionen von Perlego. Die einzigen Unterschiede bestehen im Preis und dem Abozeitraum: Mit dem Jahresabo sparst du auf 12 Monate gerechnet im Vergleich zum Monatsabo rund 30 %.
Was ist Perlego?
Wir sind ein Online-Abodienst für Lehrbücher, bei dem du für weniger als den Preis eines einzelnen Buches pro Monat Zugang zu einer ganzen Online-Bibliothek erhältst. Mit über 1 Million Büchern zu über 1.000 verschiedenen Themen haben wir bestimmt alles, was du brauchst! Weitere Informationen hier.
Unterstützt Perlego Text-zu-Sprache?
Achte auf das Symbol zum Vorlesen in deinem nächsten Buch, um zu sehen, ob du es dir auch anhören kannst. Bei diesem Tool wird dir Text laut vorgelesen, wobei der Text beim Vorlesen auch grafisch hervorgehoben wird. Du kannst das Vorlesen jederzeit anhalten, beschleunigen und verlangsamen. Weitere Informationen hier.
Ist Unity 2020 Mobile Game Development als Online-PDF/ePub verfügbar?
Ja, du hast Zugang zu Unity 2020 Mobile Game Development von John P. Doran im PDF- und/oder ePub-Format sowie zu anderen beliebten Büchern aus Computer Science & Programming Games. Aus unserem Katalog stehen dir über 1 Million Bücher zur Verfügung.

Information

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

Inhaltsverzeichnis