Cover....1
Title Page....2
Copyright and Credits....3
Dedication....4
Contributors....5
Table of Contents....8
Preface....14
Part 1: Gameplay/Development Setup....22
Chapter 1: Building Your Game....24
Technical requirements....25
Setting up the project....25
Creating the player....27
Moving the player through a C# script....29
Improving our scripts with attributes and XML comments....33
Using attributes....33
XML comments....36
Update function versus FixedUpdate function....38
Putting it all together....39
Having the camera following our player....40
Creating a basic tile....42
Making it endless....47
Creating obstacles....53
Summary....64
Chapter 2: Project Setup for Android and iOS Development....66
Technical requirements....67
Introducing the Build Settings menu....68
Building a project for a PC....70
Exporting a project for Android....72
Installing Android Build Support for Unity....73
Updating build and player settings for Android projects....75
Running the Android APK with an emulator....80
Putting the project on your Android device....83
Unity for iOS setup and Xcode installation....94
Building a project for iOS....99
Running the project via the iOS simulator....106
Summary....108
Part 2: Mobile-Specific Features....110
Chapter 3: Mobile Input/Touch Controls....112
Technical requirements....113
Using mouse input....113
Screen space versus world space....115
Moving using touch controls....117
Using Unity Remote....122
Android setup For Unity Remote....122
Enabling developer mode and debugging....128
Unity Remote setup for iOS....135
Implementing a gesture....139
Scaling the player using pinches....144
Using the accelerometer....148
Detecting touch on game objects....151
Summary....161
Chapter 4: Resolution-Independent UI....162
Technical requirements....163
Creating a title screen....163
The Rect Transform component....167
Adjusting and resizing the title text....171
Selecting different aspect ratios....177
Working with buttons....180
Adding a pause menu....188
Pausing the game....198
Summary....200
Chapter 5: Advanced Mobile UI....202
Technical requirements....202
Adding a pause screen button....203
Implementing an on-screen joystick....208
Adapting GUIs for notch devices....214
Summary....221
Chapter 6: Implementing In-App Purchases....222
Technical requirements....223
Setting up Unity IAP....223
Creating our first purchase....225
Adding a button to restore purchases....234
Configuring purchases for the stores of your choice....237
Summary....238
Chapter 7: Advertising Using Unity Ads....240
Technical requirements....241
Setting up Unity Ads....241
Displaying a simple ad....245
Utilizing ad callback methods....248
Opt-in advertisements with rewards....252
Adding in a cooldown timer....262
Summary....267
Chapter 8: Integrating Social Media into Our Project....270
Technical requirements....271
Adding a scoring system....271
Sharing high scores via Twitter....277
Downloading and installing Facebook’s SDK....281
Logging in to our game via Facebook....290
Displaying a Facebook name and profile picture....298
Summary....305
Part 3: Game Feel/Polish....306
Chapter 9: Keeping Players Involved with Notifications....308
Technical requirements....308
Setting up notifications....309
Scheduling notifications ahead of time....314
Customizing notifications....319
Canceling notifications....324
Summary....326
Chapter 10: Using Unity Analytics....328
Technical requirements....329
Setting up Analytics....329
Tracking custom events....334
Sending basic CustomEvents....334
Sending custom events with properties....340
Working with funnels....350
Summary....352
Chapter 11: Remote Config....354
Technical requirements....354
Remote Config setup....355
Creating key-value pairs....357
Integrating Game Overrides into gameplay....360
Summary....364
Chapter 12: Improving Game Feel....366
Technical requirements....367
Animation using LeanTween....367
LeanTween setup....367
Creating a simple tween....370
Adding tweens to the pause menu....375
Working with materials....378
Using postprocessing effects....381
Adding particle effects....387
Summary....390
Chapter 13: Building a Release Copy of Our Game....392
Technical requirements....392
Generating release builds for app stores....393
Summary....403
Chapter 14: Submitting Games to App Stores....404
Technical requirements....404
Putting your game on the Google Play Store....405
Setting up the Google Play Console....405
Publishing an app on Google Play....407
Putting your game on the Apple iOS App Store....418
Apple Developer setup and creating a provisioning profile....418
Adding an app to App Store Connect....429
Summary....448
Chapter 15: Augmented Reality....450
Technical requirements....450
Setting up a project for AR....451
Basic setup....455
Interacting with the AR environment....460
Spawning objects in AR....465
Summary....468
Index....470
About Packt....476
Other Books You May Enjoy....477
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, the third edition in this popular series, 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.