O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Unity 2017 Mobile Game Development

Book Description

Learn to create, publish and monetize your mobile games with the latest Unity 2017 tool-set easily for Android and iOS

About This Book

  • One-stop solution to becoming proficient in mobile game development using Unity 2017
  • Port your Unity games to popular platforms such as iOS and Android
  • Unleash the power of C# scripting to create realistic gameplay and animations in Unity 2017.

Who This Book Is For

If you are a game developer and want to build mobile games for iOS and Android, then this is the book for you. Previous knowledge of C# and Unity is helpful, but not required.

What You Will Learn

  • Use Unity to build an endless runner game
  • Set up and deploy a project to a mobile device
  • Create interesting gameplay elements using inputs from your mobile device
  • Monetize your game projects with Unity ads and in-app purchases
  • Design UI elements that can be used well in Landscape and Portrait mode at different resolutions, supporting phones, tablets, and PCs.
  • How to submit your game to the iOS and Android app stores

In Detail

Unity has established itself as an overpowering force for developing mobile games. If you love mobile games and want to learn how to make them but have no idea where to begin, then this book is just what you need. This book takes a clear, step-by-step approach to building an endless runner game using Unity with plenty of examples on how to create a game that is uniquely your own.

Starting from scratch, you will build, set up, and deploy a simple game to a mobile device. You will learn to add touch gestures and design UI elements that can be used in both landscape and portrait mode at different resolutions. You will explore the best ways to monetize your game projects using Unity Ads and in-app purchases before you share your game information on social networks. Next, using Unity's analytics tools you will be able to make your game better by gaining insights into how players like and use your game. Finally, you'll learn how to publish your game on the iOS and Android App Stores for the world to see and play along.

Style and approach

This book takes a clear, step-by-step approach for Unity game developers to explore everything needed to develop mobile games with Unity.

Table of Contents

  1. Preface
    1. What this book covers
    2. What you need for this book
    3. Who this book is for
    4. Conventions
    5. Reader feedback
    6. Customer support
      1. Downloading the example code
      2. Errata
      3. Piracy
      4. Questions
  2. Building Your Game
    1. Chapter overview
      1. Your objectives
    2. Setting up the project
    3. Creating the player
    4. 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. Putting it all together
    5. Having the camera following our player
    6. Creating a basic tile
    7. Making it endless
    8. Creating obstacles
    9. Summary
  3. Setup for Android and iOS Development
    1. Chapter overview
      1. Our objectives
    2. Introduction to build settings
    3. Building a project for PC
      1. Installing the Java Development Kit (JDK) 
      2. Installing the Android SDK
    4. Exporting a project for Android
    5. Putting the project on your Android device
    6. Unity for iOS setup and Xcode installation
    7. Building a project for iOS
    8. Summary
  4. Mobile Input/Touch Controls
    1. Chapter overview
      1. Our objectives
    2. Using mouse input
    3. Moving via touch
    4. Implementing a gesture
    5. Using the accelerometer
    6. Detecting touch on game objects
    7. Summary
  5. Resolution Independent UI
    1. The chapter overview
      1. Our objectives
    2. Creating a title screen
      1. The Rect Transform component
        1. Anchors
        2. Pivots
      2. Selecting different aspect ratios
    3. Working with buttons
    4. Adding a pause menu
    5. Pausing the game
    6. Summary
  6. Advertising Using Unity Ads
    1. Chapter overview
      1. Your objectives
    2. Unity Ads setup
    3. Displaying a simple Ad
    4. Utilizing ad callback options
    5. Opt-in advertisements with rewards
    6. Adding in a cooldown
    7. Summary
  7. Implementing In-App Purchases
    1. Chapter overview
      1. Your objectives
    2. Setting up Unity IAP
    3. Creating our first purchase
    4. Adding button to restore purchases
    5. Configuring purchases for the stores of your choice
    6. Summary
  8. Getting Social
    1. Chapter overview
      1. Your objectives
    2. Adding a score system
    3. Sharing high scores via Twitter
    4. Downloading and installing Facebook's SDK
    5. Logging in to our game via Facebook
    6. Displaying Facebook name and profile pic
    7. Summary
  9. Using Unity Analytics
    1. Chapter overview
      1. Your objectives
    2. Setting up analytics
    3. Tracking custom events
      1. Using the AnalyticsTracker component
      2. Customizing events through code
    4. Working with the funnel analyzer
    5. Tweaking properties with remote settings
    6. Summary
  10. Making Your Title Juicy
    1. Chapter overview
      1. Your objectives
    2. Animation using iTween
      1. iTween 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
  11. Game Build and Submission
    1. Chapter overview
      1. Your objectives
    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 onto iTunes Connect
    5. Summary