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

Learning Unity Android Game Development

Book Description

Learn to create stunning Android games using Unity

In Detail

Unity 5 is a revolution in developing great games for Android that provides a great integration platform that works seamlessly with Unity 5, which means that games can be developed quicker and easier than ever before.

Packed with a lot of examples, this book starts by helping you to understand all the great features that Unity 5 and Android have to offer. You will then create great games like Tic-Tac-Toe and the Monkey Ball game and also learn to enhance them. You will then expand the game's environment with lights and a skybox and learn to create enemies in a tank battle game. You will then explore the touch and tilt controls with the creation of a Monkey Ball clone.

With the recreation of a game similar to Angry Birds, you will delve into configuring physics and options for a 2D game experience. Finally, you will get a complete experience by learning the optimization techniques needed to keep your games running smoothly.

Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

Table of Contents

  1. Learning Unity Android Game Development
    1. Table of Contents
    2. Learning Unity Android Game Development
    3. Credits
    4. About the Author
    5. About the Reviewer
    6. www.PacktPub.com
      1. Support files, eBooks, discount offers, and more
        1. Why subscribe?
        2. Free access for Packt account holders
    7. 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. Downloading the color images of this book
        3. Errata
        4. Piracy
        5. Questions
    8. 1. Saying Hello to Unity and Android
      1. Understanding what makes Unity great
      2. Unity – the best among the rest
      3. Understanding what makes Android great
      4. Understanding how Unity and Android work together
      5. Differences between the Pro and Basic versions of Unity
        1. An overview of license comparison
          1. NavMeshes, pathfinding, and crowd simulation
          2. LOD support
          3. The audio filter
          4. Video playback and streaming
          5. Fully-fledged streaming with asset bundles
          6. The 100,000 dollar turnover
          7. Mecanim – IK Rigs
          8. Mecanim – sync layers and additional curves
          9. The custom splash screen
          10. Real-time spot/point and soft shadows
          11. HDR and tone mapping
          12. Light probes
          13. Lightmapping with global illumination and area lights
          14. Static batching
          15. Render-to-texture effects
          16. Fullscreen post-processing effects
          17. Occlusion culling
          18. Deferred rendering
          19. Stencil buffer access
          20. GPU skinning
          21. Navmesh – dynamic obstacles and priority
          22. Native code plugins' support
          23. Profiler and GPU profiling
          24. Script access to the asset pipeline
          25. Dark skin
      6. Setting up the development environment
        1. Installing the JDK
        2. Installing the Android SDK
        3. Installing Unity 3D
      7. The optional code editor
      8. Connecting to a device
        1. A simple device connection
      9. Unity Remote
      10. Building a simple application
        1. Hello World
      11. Summary
    9. 2. Looking Good – The Graphical Interface
      1. Creating a Tic-tac-toe game
        1. The game board
          1. Creating the board
          2. Game squares
        2. Controlling the game
      2. Messing with fonts
      3. Rotating devices
      4. Menus and victory
        1. Setting up the elements
        2. Adding the code
        3. Putting them together
      5. A better way to build for a device
      6. Summary
    10. 3. The Backbone of Any Game – Meshes, Materials, and Animations
      1. Setting up
      2. Importing the meshes
      3. Tank import settings
        1. Meshes
        2. Normals & Tangents
        3. Materials
        4. The Revert and Apply buttons
        5. Setting up the tank
          1. The tank
          2. Keeping score
          3. Repeat buttons
          4. Controlling the chassis
          5. Controlling the turret
          6. Putting the pieces together
      4. Creating materials
        1. The city
          1. Main Maps
          2. Secondary Maps
        2. Moving treads
      5. Animations in Unity
        1. The target's animations
        2. State machines to control animations in Unity
          1. Target state machine
          2. Scripting the target
        3. Creating the prefab
      6. Ray tracing to shooting
      7. Summary
    11. 4. Setting the Stage – Camera Effects and Lighting
      1. Camera effects
        1. Skyboxes and distance fog
        2. Target indicator
          1. Creating the pointer
          2. Controlling the indicator
          3. Working with a second camera
        3. Turbo boost
      2. Lights
        1. Adding more lights
        2. Lightmaps
        3. Cookies
      3. Blob shadows
      4. Summary
    12. 5. Getting Around – Pathfinding and AI
      1. Understanding AI and pathfinding
      2. The NavMesh
      3. The NavMeshAgent component
      4. Making the enemy chase the player
        1. Revealing the player's location
        2. Chasing the player
      5. Being attacked by the enemy
      6. Attacking the enemy
      7. Spawning enemy tanks
      8. Summary
    13. 6. Specialities of the Mobile Device – Touch and Tilt
      1. Setting up the development environment
      2. A basic environment
      3. Controlling with tilt
        1. Following with the camera
        2. Adding the monkey
      4. Keeping the monkey on the board
      5. Winning and losing the game
      6. Putting together the complex environment
      7. Adding bananas
        1. Collecting bananas with touch
      8. Summary
    14. 7. Throwing Your Weight Around – Physics and a 2D Camera
      1. 2D games in a 3D world
        1. Setting up the development environment
      2. Physics
        1. Building blocks
        2. Physics materials
      3. Characters
        1. Creating the enemy
        2. Creating the ally
      4. Controls
        1. Attacking with a slingshot
        2. Watching with the camera
      5. Creating the parallax background
      6. Adding more birds
        1. The yellow bird
        2. The blue bird
        3. The black bird
      7. Level selection
      8. Summary
    15. 8. Special Effects – Sound and Particles
      1. Understanding audio
        1. Import settings
        2. Audio Listener
        3. Audio Source
        4. Adding background music
        5. Poking bananas
      2. Understanding particle systems
        1. Particle system settings
        2. Creating dust trails
      3. Putting it together
        1. Exploding bananas
      4. Summary
    16. 9. Optimization
      1. Minimizing the application footprint
        1. Editor log
        2. Asset compression
          1. Models
          2. The Model tab
          3. The Rig tab
          4. The Animations tab
          5. Textures
          6. Audio
        3. Player settings
          1. Rendering
          2. Optimization
      2. Tracking performance
        1. Editor statistics
        2. The Profiler
        3. Tracking script performance
      3. Minimizing lag
        1. Occlusion
        2. Tips for minimizing lag
      4. Summary
    17. Index