You are previewing Unity 5.x By Example.
O'Reilly logo
Unity 5.x By Example

Book Description

An example-based practical guide to get you up and running with Unity 5.x

About This Book

  • The most updated resource on Unity 5.x with comprehensive discussion on all the new features of Unity 5.x

  • Understand the core concepts surrounding Unity5 game development with this power-packed hands-on guide

  • Brush up your existing game development skills and create games that have a brilliant gameplay using the excellent examples from this book

  • Who This Book Is For

    The ideal target audience for this book would be game developers. They need not have previous experience with Unity since this book will cover all the basics about game development with unity. This would also be a very good resource for Unity developers who want to brush up their basic Unity skills and also get up and running with creating interesting games with Unity 5.x.

    What You Will Learn

  • Understand core Unity concepts, such as game objects, components, and scenes

  • Learn level design techniques for building immersive and interesting worlds

  • Learn to make functional games with C# scripting

  • Use the toolset creatively to build games of different themes and styles

  • Learn to handle player controls and input functionality

  • Dive into the process of working with terrains and world-creation tools

  • Import custom content into Unity from third-party tools, such as Maya and Blender

  • Get to grips with making both 2D and 3D games

  • In Detail

    Unity is an exciting and popular engine in the game industry. Throughout this book, you’ll learn how to use Unity by making four fun game projects, from shooters and platformers to exploration and adventure games.

    Unity 5 By Example is an easy-to-follow guide for quickly learning how to use Unity in practical context, step by step, by making real-world game projects. Even if you have no previous experience of Unity, this book will help you understand the toolset in depth. You'll learn how to create a time-critical collection game, a twin-stick space shooter, a platformer, and an action-fest game with intelligent enemies. In clear and accessible prose, this book will present you with step-by-step tutorials for making four interesting games in Unity 5 and explain all the fundamental concepts along the way. Starting from the ground up and moving toward an intermediate level, this book will help you establish a strong foundation in making games with Unity 5.

    Style and approach

    This book would be a very unique resource for any game developer who wants to get up and running with Unity. The unique example based approach will take you through the most basic games towards the more complex ones and will gradually build your skill level.

    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 If you purchased this book elsewhere, you can visit and register to have the code file.

    Table of Contents

    1. Unity 5.x By Example
      1. Table of Contents
      2. Unity 5.x By Example
      3. Credits
      4. About the Author
      5. About the Reviewer
        1. eBooks, discount offers, and more
          1. Why subscribe?
      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. The Coin Collection Game – Part 1
        1. Game design
        2. Getting started – Unity and projects
        3. Projects and project folders
        4. Importing assets
        5. Starting a level
        6. Transformations and navigation
        7. Scene building
        8. Lighting and sky
        9. Play testing and the Game tab
        10. Adding a water plane
        11. Adding a coin to collect
        12. Summary
      9. 2. Project A – the Collection Game Continued
        1. Creating a coin material
        2. C# scripting in Unity
        3. Counting coins
          1. Code Sample 2.3
        4. Collecting coins
          1. Code Sample 2.5
        5. Coins and prefabs
        6. Timers and countdowns
          1. Code Sample 2.6
        7. Celebrations and fireworks!
          1. Code Sample 2.7
        8. Play testing
        9. Building
        10. Summary
      10. 3. Project B – the Space Shooter
        1. Looking ahead – the completed project
        2. Getting started with a space shooter
        3. Creating a player object
        4. Player input
          1. Code Sample 3.1
        5. Configuring the game camera
        6. Bounds locking
          1. Code Sample 3.2
        7. Health
          1. Code Sample 3.3
        8. Death and particles
          1. Code Sample 3.4
        9. Enemies
          1. Code Sample 3.6
          2. Code Sample 3.7
          3. Code Sample 3.8
        10. Enemy spawning
          1. Code Sample 3.9
        11. Summary
      11. 4. Continuing the Space Shooter
        1. Guns and gun turrets
        2. Ammo prefabs
          1. Code Sample 4-1
        3. Ammo spawning
          1. Code Sample 4.2
          2. Code Sample 4.3
        4. User controls
        5. Scores and scoring – UI and text objects
        6. Working with scores – scripting with text
          1. Code Sample 4.4
        7. Polishing
        8. Testing and diagnosis
        9. Building
        10. Summary
      12. 5. Project C – a 2D Adventure
        1. A 2D Adventure – getting started
        2. Importing assets
        3. Creating an environment – getting started
        4. Environment Physics
        5. Creating a player
        6. Scripting the player movement
          1. Code Sample 5.1
        7. Optimization
        8. Summary
      13. 6. Continuing the 2D Adventure
        1. Moving platforms
          1. Code Sample 6.1
        2. Creating other scenes – levels 2 and 3
        3. Kill zones
          1. Code Sample 6.2
        4. The UI health bar
          1. Code Sample 6.3
        5. Ammo and hazards
        6. Gun turrets and ammo
        7. NPCs and quests
          1. Code Sample 6.8
        8. Summary
      14. 7. Project D – Intelligent Enemies
        1. An overview of the project
        2. Getting started
        3. Terrain construction
        4. Navigation and navigation meshes
        5. Building an NPC
          1. Code Sample 7.1
        6. Creating patrolling NPCs
        7. Summary
      15. 8. Continuing with Intelligent Enemies
        1. Enemy AI – range of sight
          1. Code Sample 8.1
        2. An overview of Finite State Machines
          1. Code Sample 8.2
        3. The Patrol state
          1. Code Sample 8.3
        4. The Chase state
          1. Code Sample 8.4
        5. The Attack state
          1. Code Sample 8.5
        6. Summary
      16. Index