Mobile Game Development with Unity

Book description

Do you want to build mobile games, but lack game development experience? No problem. This practical guide shows you how to create beautiful, interactive content for iOS and Android devices with the Unity game engine. Authors Jon Manning and Paris Buttfield-Addison (iOS Swift Game Development Cookbook) provide a top-to-bottom overview of Unity’s features with specific, project-oriented guidance on how to use them in real game situations.

Publisher resources

View/Submit Errata

Table of contents

  1. Preface
    1. Resources Used in This Book
    2. Audience and Approach
    3. Conventions Used in This Book
    4. Using Code Examples
    5. O’Reilly Safari
    6. How to Contact Us
    7. Acknowledgments
  2. I. The Basics of Unity
  3. 1. Introducing Unity
    1. Hello, Book
      1. Mobile Games
    2. Hello, Unity
      1. What’s Unity For?
      2. Getting Unity
  4. 2. A Tour of Unity
    1. The Editor
      1. Play Mode and Edit Mode
    2. The Scene View
      1. The Mode Selector
      2. Getting Around
      3. Handle Controls
    3. The Hierarchy
    4. The Project View
    5. The Inspector
    6. The Game View
    7. Wrapping Up
  5. 3. Scripting in Unity
    1. A Crash Course in C#
    2. Mono and Unity
      1. MonoDevelop
    3. Game Objects, Components, and Scripts
      1. The Inspector
      2. Components
    4. Important Methods
      1. Awake and OnEnable
      2. Start
      3. Update and LateUpdate
    5. Coroutines
    6. Creating and Destroying Objects
      1. Instantiation
      2. Creating an Object from Scratch
      3. Destroying Objects
    7. Attributes
    8. Time in Scripts
    9. Logging to the Console
    10. Wrapping Up
  6. II. Building a 2D Game: Gnome on a Rope
  7. 4. Getting Started Building the Game
    1. Game Design
    2. Creating the Project and Importing Assets
    3. Creating the Gnome
    4. Rope
      1. Coding the Rope
      2. Configuring the Rope
    5. Wrapping Up
  8. 5. Preparing for Gameplay
    1. Input
      1. Unity Remote
      2. Adding Tilt Control
      3. Controlling the Rope
      4. Making the Camera Follow the Gnome
      5. Scripts and Debugging
    2. Setting Up the Gnome’s Code
    3. Setting Up the Game Manager
      1. Setting Up and Resetting the Game
      2. Creating a New Gnome
      3. Removing the Old Gnome
      4. Resetting the Game
      5. Dealing with Touching
      6. Reaching the Exit
      7. Pausing and Unpausing
      8. Handling the Reset Button
    4. Preparing the Scene
    5. Wrapping Up
  9. 6. Building Gameplay with Traps and Objectives
    1. Simple Traps
    2. Treasure and Exit
      1. Creating the Exit
    3. Adding a Background
    4. Wrapping Up
  10. 7. Polishing the Game
    1. Updating the Gnome’s Art
    2. Updating the Physics
    3. Background
      1. Layers
      2. Creating the Backgrounds
      3. Different Backgrounds
      4. The Bottom of the Well
      5. Updating the Camera
    4. User Interface
    5. Invincibility Mode
    6. Wrapping Up
  11. 8. Final Touches on Gnome’s Well
    1. More Traps and Level Objects
      1. Spikes
      2. Spinning Blade
      3. Blocks
    2. Particle Effects
      1. Defining the Particle Material
      2. The Blood Fountain
      3. The Blood Explosion
      4. Using the Particle Systems
    3. Main Menu
      1. Scene Loading
    4. Audio
    5. Wrapping Up and Challenges
  12. III. Building a 3D Game: Space Shooter
  13. 9. Building a Space Shooter
    1. Designing the Game
      1. Getting the Assets
    2. Architecture
    3. Creating the Scene
      1. Ship
      2. Space Station
      3. Skybox
      4. Canvas
    4. Wrapping Up
  14. 10. Input and Flight Control
    1. Input
      1. Adding the Joystick
      2. The Input Manager
    2. Flight Control
      1. Indicators
      2. Indicator Manager
    3. Wrapping Up
  15. 11. Adding Weapons and Targeting
    1. Weapons
      1. Ship Weapons
      2. Fire Button
    2. Target Reticle
    3. Wrapping Up
  16. 12. Asteroids and Damage
    1. Asteroids
      1. Asteroid Spawner
    2. Damage-Dealing and Taking
      1. Explosions
    3. Wrapping Up
  17. 13. Audio, Menus, Death, and Explosions!
    1. Menus
      1. Main Menu
      2. Paused Screen
      3. Game Over Screen
      4. Adding a Pause Button
    2. Game Manager and Death
      1. Start Points
      2. Creating the Game Manager
      3. Setting Up the Scene
    3. Boundaries
      1. Creating the UI
      2. Coding the Boundary
    4. Final Polish
      1. Space Dust
      2. Trail Renderers
      3. Audio
      4. Explosions
    5. Wrapping Up
  18. IV. Advanced Features
  19. 14. Lighting and Shaders
    1. Materials and Shaders
      1. Fragment-Vertex (Unlit) Shaders
    2. Global Illumination
      1. Light Probes
    3. Thinking About Performance
      1. The Profiler
      2. Getting Data from Your Device
      3. General Tips
    4. Wrapping Up
  20. 15. Creating GUIs in Unity
    1. How GUIs Work in Unity
      1. Canvas
      2. RectTransform
      3. The Rect Tool
      4. Anchors
    2. Controls
    3. Events and Raycasts
      1. Responding to Events
    4. Using the Layout System
    5. Scaling the Canvas
    6. Transitioning Between Screens
    7. Wrapping Up
  21. 16. Editor Extensions
    1. Making a Custom Wizard
    2. Making a Custom Editor Window
      1. The Editor GUI API
      2. The Asset Database
    3. Making a Custom Property Drawer
      1. Creating the Class
      2. Setting the Height of the Property
      3. Overriding OnGUI
      4. Getting the Properties
      5. Creating a property scope
      6. Drawing the Label
      7. Calculating the Rectangles
      8. Getting the Values
      9. Creating the Change Check
      10. Drawing the Slider
      11. Drawing the Fields
      12. Checking for Changes
      13. Storing the Properties
      14. Testing It Out
    4. Making a Custom Inspector
      1. Creating a Simple Script
      2. Creating a Custom Inspector
      3. Setting Up the Class
      4. Defining the Colors and Properties
      5. Setting Up the Variables
      6. Starting to Draw the GUI
      7. Drawing the Controls
      8. Applying Changes
      9. Testing It Out
    5. Wrapping Up
  22. 17. Beyond the Editor
    1. The Unity Services Ecosystem
      1. The Asset Store
      2. Unity Cloud Build
      3. Unity Ads
    2. Deployment
      1. Setting Up Your Project
      2. Setting Your Target
      3. Building for Your Platform
    3. Where to Go from Here
  23. Index

Product information

  • Title: Mobile Game Development with Unity
  • Author(s): Jonathon Manning, Paris Buttfield-Addison
  • Release date: August 2017
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9781491944745