Unity 2020 Mobile Game Development - Second Edition

Book description

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.

Table of contents

  1. Title Page
  2. Copyright and Credits
    1. Unity 2020 Mobile Game Development Second Edition
  3. Dedication
  4. About Packt
    1. Why subscribe?
  5. Contributors
    1. About the author
    2. About the reviewer
    3. Packt is searching for authors like you
  6. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Download the color images
      3. Conventions used
    4. Get in touch
      1. Reviews
  7. Building Your Game
    1. Technical requirements
    2. Setting up the project
    3. Creating the player
    4. Moving the player through a C# script
    5. Improving our scripts with attributes and XML comments
      1. Using attributes
        1. The Tooltip attribute
        2. The Range attribute
        3. The RequireComponent attribute
      2. XML comments
      3. Update versus FixedUpdate
      4. Putting it all together
    6. Having the camera following our player
    7. Creating a basic tile
    8. Making it endless
    9. Creating obstacles
    10. Summary
  8. Project Setup for Android and iOS Development
    1. Technical requirements
    2. An introduction to build settings
    3. Building a project for PC
    4. Exporting a project for Android
      1. Installing Android Build Support for Unity
      2. Updating build and player settings for Android projects
    5. Putting the project on your Android device
    6. Unity for iOS setup and Xcode installation
    7. Building a project for iOS
    8. Summary
  9. Mobile Input/Touch Controls
    1. Technical requirements
    2. Using mouse input
    3. Moving using touch controls
    4. Implementing a gesture
    5. Scaling the player using pinches
    6. Using the accelerometer
    7. Detecting touch on game objects
    8. Summary
  10. Resolution-Independent UI
    1. Technical requirements
    2. Creating a title screen
      1. The Rect Transform component
        1. Anchors
        2. Pivots
      2. Adjusting and resizing the title text
      3. Selecting different aspect ratios
    3. Working with buttons
    4. Adding a pause menu
    5. Pausing the game
    6. Adapting GUI for notch devices
    7. Summary
  11. Advertising Using Unity Ads
    1. Technical requirements
    2. Setting up Unity Ads
    3. Displaying a simple ad
    4. Utilizing ad callback methods
    5. Opt-in advertisements with rewards
    6. Adding in a cooldown timer
    7. Summary
  12. Implementing In-App Purchases
    1. Technical requirements
    2. Setting up Unity IAP
    3. Creating our first purchase
    4. Adding a button to restore purchases
      1. Configuring purchases for the stores of your choice
    5. Summary
    6. Further reading
  13. Getting Social
    1. Technical requirements
    2. Adding a scoring system
    3. Sharing high scores via Twitter
    4. Downloading and installing Facebook's SDK
    5. Logging in to our game via Facebook
    6. Displaying a Facebook name and profile picture
    7. Summary
  14. Keeping Players Involved with Notifications
    1. Technical requirements
    2. Setting up notifications
    3. Scheduling notifications ahead of time
    4. Customizing notifications
    5. Summary
  15. Using Unity Analytics
    1. Technical requirements
    2. Setting up Analytics
    3. Tracking Custom Events
      1. Sending basic CustomEvents
      2. Sending Custom Events with properties
    4. Working with Funnel Analyzer
    5. Tweaking properties with Remote Settings
    6. Summary
  16. Making Your Title Juicy
    1. Technical requirements
    2. Animation using LeanTween
      1. LeanTween setup
      2. Creating a simple tween
    3. Adding tweens to the pause menu
    4. Working with materials
    5. Using post-processing effects
    6. Adding particle effects
    7. Summary
  17. Game Build and Submission
    1. Technical requirements
    2. Building a release copy of our game
    3. Putting your game on the Google Play Store
      1. Setting up the Google Play Console
      2. Publishing an app on Google Play
    4. Putting your game on the Apple iOS App Store
      1. Apple Developer setup and the creation of a provisioning profile
      2. Adding an app to iTunes Connect
    5. Summary
  18. Augmented Reality
    1. Technical requirements
    2. Setting up a project for AR
    3. Basic setup
    4. Detecting surfaces
    5. Interacting with the AR environment
    6. Spawning objects in AR
    7. Summary
  19. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think

Product information

  • Title: Unity 2020 Mobile Game Development - Second Edition
  • Author(s): John P. Doran
  • Release date: August 2020
  • Publisher(s): Packt Publishing
  • ISBN: 9781838987336