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

Mastering Unity 5.x

Book Description

Create amazing games with solid gameplay features, using a professional-grade workflow inside the Unity engine!

About This Book

  • Become a Unity master by creating a practical, in-depth game-development project with Unity
  • Use advanced C# scripting to unlock the complete potential of Unity 5
  • Use Version Control to Effectively Manage and Scale your workflow

Who This Book Is For

If you are a Unity developer who now wants to develop and deploy interesting games by leveraging the new features of Unity 5.x, then this is the book for you. Basic knowledge of C# programming is assumed.

What You Will Learn

  • Explore hands-on tasks and real-world scenarios to make a Unity horror adventure game
  • Create enemy characters that act intelligently and make reasoned decisions
  • Use data files to save and restore game data in a way that is platform-agnostic
  • Get started with VR development
  • Use Navigation Meshes, Occlusion Culling, and the Profiler tools
  • Work confidently with GameObjects, Rotations, and Transformations
  • Understand specific gameplay features such as AI enemies, inventory systems, and level design

In Detail

Do you want to take the leap from being an everyday Unity developer to being a pro game developer? Then look no further! This book is your one stop solution to creating mesmerizing games with lifelike features and amazing gameplay.

This book takes an in-depth focus on a practical project with Unity, building a first-person game with many features. You'll dive deep into the architecture of a Unity game, creating expansive worlds, interesting render effects, and other features to make your games special. You will create individual game components, use efficient animation techniques, and implement collision and physics effectively. Specifically, we'll explore optimal techniques for importing game assets, such as meshes and textures; tips and tricks for effective level design; how to animate and script NPCs; how to configure and deploy to mobile devices; how to prepare for VR development; and how to work with version control, and more.

By the end of this book, you'll have developed sufficient competency in Unity development to produce fun games with confidence.

Style and approach

This book takes a step-by-step, practical tutorial approach. You will create an advanced level Unity game with an emphasis on leveraging the advanced Unity 5 features. You will make the most of the Unity 5 advanced features while you develop the game in its entirety.

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 code file.

Table of Contents

  1. Mastering Unity 5.x
    1. Mastering Unity 5.x
    2. Credits
    3. About the Author
    4. Acknowledgment
    5. About the Reviewer
    6. www.PacktPub.com
      1. Why subscribe?
    7. Customer Feedback
    8. 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
    9. 1. Preparation and Asset-Configuring
      1. Getting clear on design
        1. Target Platforms
        2. Intended audience
        3. Genre
        4. Game mode
        5. Game objective
      2. Asset preparation
        1. Meshes - work only with good topology
        2. Meshes - minimize polygon count
        3. Meshes - simulating bump details without geometry
        4. Meshes - minimize UV seams
        5. Meshes - export as FBX
        6. Meshes - use meters scale (metric)
        7. Textures - never use lossless compression
        8. Textures - power of 2 sizes
        9. Textures - alpha textures
      3. Asset importing for Dead Keys
        1. Importing textures
        2. Importing meshes
        3. Importing animations
        4. Importing audio
        5. Configuring materials
      4. Summary
    10. 2. Level Design and Structure
      1. Setting the scene with a skybox
      2. Level building - modular construction sets
      3. Level building - organization and structure
      4. Level design - tips and tricks
        1. Objective and feedback
        2. Narrative
        3. Believability and convenience
        4. Atmosphere and aesthetic
        5. Simplicity and reuse
      5. Level lighting - preparation
        1. Baked lighting
        2. Dynamic lighting
        3. Precomputed global illumination
      6. Getting started with lightmapping
      7. Baking lightmaps - resolution and size
      8. Baking lightmaps - details
      9. Light Probes
      10. Lighting FAQ
      11. Navigation mesh
      12. Occlusion Culling
      13. Creating a player camera
      14. Particle systems
      15. Music and audio
      16. Summary
    11. 3. Player Controls - Movement
      1. Player movement
      2. Zombie combat
      3. Creating player waypoints
      4. Animating the camera
      5. Configuring an animator graph
      6. Working with animation - creating the navigator
        1. Customizing and changing MonoDevelop
        2. Singletons
        4. Connecting to the navigator component
      7. Navigator GUI
        1. Input axes
        2. The canvas
        3. The button
        4. Coding button behavior
        6. Creating player death
      8. Summary
    12. 4. Player Controls - Typing and Health
      1. Word combat
      2. Creating a word list
      3. Using Visual Studio Code
      4. Creating a WordList class
      5. Matching words
      6. The Typer object
      7. Progressing with the Typer class
      8. Health and damage
      9. Damage and feedback
      10. Player score
      11. Bonus items
      12. Summary
    13. 5. Enemies and Artificial Intelligence
      1. Configuring the zombie character
      2. Getting started with the zombie Prefab
      3. Planning the zombie Artificial Intelligence
      4. Developing state structure
      5. Developing an NPC Animator Controller
      6. Developing the Idle state
      7. Developing the Chase state
      8. Developing the Attack state and more
      9. Developing the Dead state
      10. Zombies and text input
      11. Zombies and the Typer class
      12. Activating enemies and camera paths
      13. Working with Play mode
      14. Summary
    14. 6. Project Management and Version Control
      1. Project Management
        1. Research, design, and work assessment
        2. Workload plan
        3. Task status
        4. Risk Analysis
        5. Resources and skills needed
        6. Testing plan
      2. Applied Project Management using Trello
      3. Collaboration with cloud storage
      4. Version control using Git
      5. Getting started with Git and GitKraken
        1. Commits and branches
        2. Forwards and backwards with Git
      6. Configuring Unity for version control
      7. Reverting and discarding
      8. Branches and branching
      9. Conflicts and resolving
      10. Git and the Web
      11. Pushing and pulling
      12. Cloning
      13. Summary
    15. 7. Persistent Data - Load and Save Game States
      1. Data Serialization
      2. Player preferences - saving data
      3. Player preferences - loading data
      4. Player preferences - INI files
        1. Comments on iniParser.cs
      5. Saving data - XML files
      6. Saving data - JSON files
      7. Saving data - binary files
      8. Saving data for Dead Keys
      9. Summary
    16. 8. Performance, Optimization, Mobiles, and More
      1. Stats and performance
      2. Profiler and performance assessment
      3. Optimization tips and tricks
        1. Strings and comparisons
        2. Beware of functions in disguise
        3. Debug cleaning
        4. Optimizing build size
      4. Getting started with mobile development
      5. Moving forwards with mobile development
      6. Building for Android
      7. Building for VR (Virtual Reality)
      8. Summary