Unity 2022 Mobile Game Development - Third Edition

Book description

Get started with mobile game development with this practical, illustrated guide on how to use Unity 2022 and C# to build cross-platform mobile games and add augmented reality features to your projects

Key Features

  • Create, deploy, and monetize immersive mobile games on Android and iOS with Unity 2022
  • Integrate augmented reality in your mobile projects to add real-world elements to your games
  • Explore step-by-step instructions and a demo game project to kickstart your game development journey

Book Description

Unity is a well-established player in the mobile game development sphere, and its new release, Unity 2022, is packed with new, exciting features. In Unity 2022 Mobile Game Development, Third Edition, you'll get to grips with the Unity game engine by building a mobile game and publishing it on the most popular mobile app stores as well as exploring the all-new features.

This book provides a comprehensive and practical approach to mobile game development, helping you build an endless runner game. Starting with setting up a simple Unity project for mobile development, you’ll delve into various essential aspects needed to successfully create and publish your game. You’ll acquire a range of skills, such as incorporating touch gestures, monetizing your game with Unity Ads and in-app purchases, designing an intuitive UI, and seamlessly integrating social media functionalities. Additionally, you’ll gain valuable insights into player preferences and behavior using Unity's analytics tools. You’ll also explore features of augmented reality in Unity 2022, enhancing your game's appeal.

By the end of this book, you’ll be well-equipped to reap the power of Unity 2022 to build, optimize, and publish robust cross-platform mobile games with C#, as well as widening your skill set and enhancing your credentials as a game developer.

What you will learn

  • Design responsive UIs for your mobile games
  • Detect collisions, receive user input, and create player movements
  • Create interesting gameplay elements using mobile device input
  • Add custom icons and presentation options
  • Keep players engaged by using Unity s mobile notification package
  • Integrate social media into your projects
  • Add augmented reality features to your game for real-world appeal
  • Make your games juicy with post-processing and particle effects

Who this book is for

If you are a game developer or mobile developer looking to learn Unity and employ 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 isn’t mandatory.

Table of contents

  1. Unity 2022 Mobile Game Development
  2. Contributors
  3. About the author
  4. About the reviewers
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
    4. Download the example code files
    5. Download the color images
    6. Conventions used
    7. Get in touch
    8. Share Your Thoughts
    9. Download a free PDF copy of this book
  6. Part 1: Gameplay/Development Setup
  7. Chapter 1: 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
      2. XML comments
    6. Update function versus FixedUpdate function
      1. Putting it all together
    7. Having the camera following our player
    8. Creating a basic tile
    9. Making it endless
    10. Creating obstacles
    11. Summary
  8. Chapter 2: Project Setup for Android and iOS Development
    1. Technical requirements
    2. Introducing the Build Settings menu
    3. Building a project for a PC
    4. Exporting a project for Android
      1. Installing Android Build Support for Unity
      2. Updating build and player settings for Android projects
    5. Running the Android APK with an emulator
    6. Putting the project on your Android device
    7. Unity for iOS setup and Xcode installation
    8. Building a project for iOS
    9. Running the project via the iOS simulator
    10. Summary
  9. Part 2: Mobile-Specific Features
  10. Chapter 3: Mobile Input/Touch Controls
    1. Technical requirements
    2. Using mouse input
      1. Screen space versus world space
    3. Moving using touch controls
    4. Using Unity Remote
      1. Android setup For Unity Remote
      2. Enabling developer mode and debugging
      3. Unity Remote setup for iOS
    5. Implementing a gesture
    6. Scaling the player using pinches
    7. Using the accelerometer
    8. Detecting touch on game objects
    9. Summary
  11. Chapter 4: Resolution-Independent UI
    1. Technical requirements
    2. Creating a title screen
      1. The Rect Transform component
      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. Summary
  12. Chapter 5: Advanced Mobile UI
    1. Technical requirements
    2. Adding a pause screen button
    3. Implementing an on-screen joystick
    4. Adapting GUIs for notch devices
    5. Summary
  13. Chapter 6: Implementing In-App Purchases
    1. Technical requirements
    2. Setting up Unity IAP
      1. Creating our first purchase
    3. Adding a button to restore purchases
      1. Configuring purchases for the stores of your choice
    4. Summary
  14. Chapter 7: 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
  15. Chapter 8: Integrating Social Media into Our Project
    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
  16. Part 3: Game Feel/Polish
  17. Chapter 9: Keeping Players Involved with Notifications
    1. Technical requirements
    2. Setting up notifications
    3. Scheduling notifications ahead of time
    4. Customizing notifications
    5. Canceling notifications
    6. Summary
  18. Chapter 10: 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 funnels
    5. Summary
  19. Chapter 11: Remote Config
    1. Technical requirements
    2. Remote Config setup
      1. Creating key-value pairs
    3. Integrating Game Overrides into gameplay
    4. Summary
  20. Chapter 12: Improving Game Feel
    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 postprocessing effects
    6. Adding particle effects
    7. Summary
  21. Chapter 13: Building a Release Copy of Our Game
    1. Technical requirements
    2. Generating release builds for app stores
      1. Summary
  22. Chapter 14: Submitting Games to App Stores
    1. Technical requirements
    2. Putting your game on the Google Play Store
      1. Setting up the Google Play Console
    3. Publishing an app on Google Play
    4. Putting your game on the Apple iOS App Store
      1. Apple Developer setup and creating a provisioning profile
      2. Adding an app to App Store Connect
    5. Summary
  23. Chapter 15: Augmented Reality
    1. Technical requirements
    2. Setting up a project for AR
    3. Basic setup
    4. Interacting with the AR environment
    5. Spawning objects in AR
    6. Summary
  24. Index
    1. Why subscribe?
  25. Other Books You May Enjoy
    1. Packt is searching for authors like you
    2. Download a free PDF copy of this book

Product information

  • Title: Unity 2022 Mobile Game Development - Third Edition
  • Author(s): John P. Doran
  • Release date: June 2023
  • Publisher(s): Packt Publishing
  • ISBN: 9781804613726