You are previewing Unity 3 Game Development HOTSHOT.
O'Reilly logo
Unity 3 Game Development HOTSHOT

Book Description

Eight projects specifically designed to exploit Unity's full potential

  • Cool, fun, advanced aspects of Unity Game Development, from creating a rocket launcher to building your own destructible game world

  • Master advanced Unity techniques such as surface shader programming and AI programming

  • Full of coding samples, diagrams, tips and tricks to keep your code organized, and completed art assets with clear step-by-step examples and instructions

  • Elite Unity programming for those looking to take their skills to the next level

In Detail

Unity 3d is the game engine of choice for creating professional looking games at no cost. Its combination of powerful tools and outstanding community support make it the natural choice for experienced and aspiring game developers.

Unity3D Game Development Hotshot will show you how to exploit the full array of Unity3Dtechnology in order to create an advanced gaming experience for the user. It has eight exciting and challenging projects with step- by-step explanations, diagrams, screenshots, and downloadable materials.

Every project is designed to push your Unity skills to the very limits and beyond. You will create a hero/heroine for a role playing game. Create a menu for the RPG game allowing you to customize your character with powerups, armor, and weapons. You will shade, model, rig, and animate your hero/heroine. The end result will be a character on the level of Final Fantasy, far superior to a simple sprite.

Now for some damage - rocket launchers! Typically the most powerful weapons in any first person shooter, you will create a rocket launcher that has fire and smoke particles and most importantly causes splash damage for that all important area effect. Create AI controlled enemies for your hero/heroine to eliminate with the rocket launcher. Forge a destructible interactive world so if the rocket launchers miss their target they will at least cause significant damage to the surrounding environment. Learn to save and load your game so you can take a break from the action for life’s necessities like going to the bathroom. Incorporate social gaming by uploading scores online so everyone can see the carnage.

Table of Contents

  1. Unity 3 Game Development HOTSHT
    1. Table of Contents
    2. Unity 3 Game Development HOTSHT
    3. Credits
    4. About the Author
    5. About the Reviewers
    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
        1. Mission briefing
        2. Why Is It Awesome?
        3. Your Hotshot Objectives
        4. Mission Checklist
        5. Task 1
        6. Prepare for Lift Off
        7. Engage Thrusters
        8. Objective Complete - Mini Debriefing
        9. Classified Intel
      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. Develop a Sprite and Platform Game
      1. Mission briefing
        1. What does it do?
        2. Why Is It Awesome?
        3. Your Hotshot Objectives
        4. Mission Checklist
      2. Creating a camera and a level
        1. Prepare for Lift Off
        2. Engage Thrusters
        3. Objective Complete - Mini Debriefing
        4. Classified Intel
      3. Creating a 2D character
        1. Prepare for Lift Off
        2. Engage Thrusters
        3. Objective Complete - Mini Debriefing
        4. Classified Intel
          1. Box Collider and Mesh Collider
      4. Creating CharacterControl class and SpriteManager class
        1. Prepare for Lift Off
        2. Engage Thrusters
        3. Objective Complete - Mini Debriefing
        4. Classified Intel
          1. Input Manager
      5. Jumping and physics
        1. Engage Thrusters
        2. Objective Complete - Mini Debriefing
        3. Classified Intel
          1. Physics.Raycast
      6. Creating a key and door
        1. Prepare for Lift Off
        2. Engage Thrusters
        3. Objective Complete - Mini Debriefing
        4. Classified Intel
          1. Coroutines
      7. Adding a sound and replay button
        1. Prepare for Lift Off
        2. Engage Thrusters
        3. Objective Complete - Mini Debriefing
        4. Classified Intel
      8. Game over-Wrapping it up
      9. Are you ready to go gung ho? A Hotshot challenge
    9. 2. Create a Menu for an RPG Game—Add Powerups, Weapons, and Armor
      1. Mission briefing
        1. What does it do?
        2. Why Is It Awesome?
        3. Your Hotshot Objectives
        4. Mission Checklist
      2. Custom skin with GUI Skin
        1. Prepare for Lift Off
        2. Engage Thrusters
        3. Objective Complete - Mini Debriefing
        4. Classified Intel
      3. Creating a menu object
        1. Prepare for Lift Off
        2. Engage Thrusters
        3. Objective Complete - Mini Debriefing
        4. Classified Intel
      4. Creating a status tab
        1. Engage Thrusters
        2. Objective Complete - Mini Debriefing
        3. Classified Intel
      5. Creating an inventory tab
        1. Engage Thrusters
        2. Objective Complete - Mini Debriefing
        3. Classified Intel
      6. Creating an equipment tab
        1. Engage Thrusters
        2. Objective Complete - Mini Debriefing
        3. Classified Intel
      7. Game over-Wrapping it up
      8. Are you ready to go gung ho? A Hotshot challenge
    10. 3. Model and Shade your Hero/Heroine
      1. Mission briefing
        1. What does it do?
        2. Why Is It Awesome?
        3. Your Hotshot Objectives
        4. Mission Checklist
      2. Exporting from 3D Studio Max
        1. Prepare for Lift Off
        2. Engage Thrusters
        3. Objective Complete - Mini Debriefing
        4. Classified Intel
      3. Shader programming—Diffuse and bump (normal) map
        1. Prepare for Lift Off
        2. Engage Thrusters
        3. Objective Complete - Mini Debriefing
        4. Classified Intel
      4. Shader programming—Ambient and specular light
        1. Engage Thrusters
        2. Objective Complete - Mini Debriefing
        3. Classified Intel
      5. Shader programming—Rim light and toon ramp
        1. Engage Thrusters
        2. Objective Complete - Mini Debriefing
      6. Game over-Wrapping it up
      7. Are you ready to go gung ho? A Hotshot challenge
    11. 4. Add Character Control and Animation to our Hero/Heroine
      1. Mission briefing
        1. What does it do?
        2. Why Is It Awesome?
        3. Your Hotshot Objectives
        4. Mission Checklist
      2. Setting up character animation and level
        1. Prepare for Lift Off
        2. Engage Thrusters
        3. Objective Complete - Mini Debriefing
        4. Classified Intel
      3. Creating the character controller and built-in script
        1. Prepare for Lift Off
        2. Engage Thrusters
        3. Objective Complete - Mini Debriefing
        4. Classified Intel
      4. Creating a custom character control script
        1. Prepare for Lift Off
        2. Engage Thrusters
        3. Objective Complete - Mini Debriefing
        4. Classified Intel
      5. Creating CrossFade animation
        1. Engage Thrusters
        2. Objective Complete - Mini Debriefing
        3. Classified Intel
      6. Creating a third-person camera to follow our character
        1. Prepare for Lift Off
        2. Engage Thrusters
        3. Objective Complete - Mini Debriefing
        4. Classified Intel
      7. Game over-Wrapping it up
      8. Are you ready to go gung ho? A Hotshot challenge
    12. 5. Build a Rocket Launcher!
      1. Mission briefing
        1. What does it do?
        2. Why Is It Awesome?
        3. Your Hotshot Objectives
        4. Mission Checklist
      2. Setting up the character with the first-person controller prefab
        1. Prepare for Lift Off
        2. Engage Thrusters
        3. Objective Complete - Mini Debriefing
        4. Classified Intel
      3. Creating the New3PSController and MouseLook_JS scripts
        1. Prepare for Lift Off
        2. Engage Thrusters
        3. Objective Complete - Mini Debriefing
        4. Classified Intel
      4. Creating the rocket launcher and scope target
        1. Engage Thrusters
        2. Objective Complete - Mini Debriefing
        3. Classified Intel
      5. Creating the rockets and particles
        1. Engage Thrusters
        2. Objective Complete - Mini Debriefing
        3. Classified Intel
      6. Creating the rocket bullet UI
        1. Engage Thrusters
        2. Objective Complete - Mini Debriefing
        3. Classified Intel
      7. Game over-Wrapping it up
      8. Are you ready to go gung ho? A Hotshot challenge
    13. 6. Create Smart AI
      1. Mission briefing
        1. What does it do?
        2. Why Is It Awesome?
        3. Your Hotshot Objectives
        4. Mission Checklist
      2. Creating the waypoint and gizmos
        1. Prepare for Lift Off
        2. Engage Thrusters
        3. Objective Complete - Mini Debriefing
        4. Classified Intel
      3. Creating an enemy AI
        1. Engage thrusters
        2. Objective Complete - Mini Debriefing
      4. Creating the enemy movement with AIController script
        1. Engage Thrusters
        2. Objective Complete - Mini Debriefing
        3. Classified Intel
      5. Creating a hit-point UI
        1. Engage Thrusters
        2. Objective Complete - Mini Debriefing
        3. Classified Intel
      6. Game over-Wrapping it up
      7. Are you ready to go gung ho? A Hotshot challenge
    14. 7. Forge a Destructible and Interactive Virtual World
      1. Mission briefing
        1. What does it do?
        2. Why Is It Awesome?
        3. Your Hotshot Objectives
        4. Mission Checklist
      2. Optimizing the AIController script
        1. Prepare for Lift Off
        2. Engage Thrusters
        3. Objective Complete - Mini Debriefing
        4. Classified Intel
      3. Creating a ragdoll
        1. Prepare for Lift Off
        2. Engage Thrusters
        3. Objective Complete - Mini Debriefing
        4. Classified Intel
      4. Creating a destructible wall
        1. Prepare for Lift Off
        2. Engage Thrusters
        3. Objective Complete - Mini Debriefing
        4. Classified Intel
      5. Creating a rockslide and trigger area
        1. Prepare for Lift Off
        2. Engage Thrusters
        3. Objective Complete - Mini Debriefing
        4. Classified Intel
      6. Game over-Wrapping it up
      7. Are you ready to go gung ho? A Hotshot challenge
    15. 8. Let the World See the Carnage! Save, Load, and Post High Scores
      1. Mission briefing
        1. What Does It Do?
        2. Why Is It Awesome?
        3. Your Hotshot Objectives
        4. Mission Checklist
      2. Creating a high score menu
        1. Prepare for Lift Off
        2. Engage Thrusters
        3. Objective Complete - Mini Debriefing
        4. Classified Intel
      3. Saving and loading the local high score
        1. Prepare for Lift Off
        2. Engage Thrusters
        3. Objective Complete - Mini Debriefing
        4. Classified Intel
      4. Getting XML data from the server
        1. Prepare for Lift Off
        2. Engage Thrusters
        3. Objective Complete - Mini Debriefing
        4. Classified Intel
      5. Posting and loading high scores to the server
        1. Prepare for Lift Off
        2. Engage Thrusters
        3. Objective Complete - Mini Debriefing
        4. Classified Intel
      6. Game over-Wrapping it up
      7. Are you ready to go gung ho? A Hotshot challenge
    16. A. Important Functions
      1. Awake
        1. Example
      2. Start
        1. Example
      3. Update
        1. Example
      4. FixedUpdate
        1. Example
      5. LateUpdate
        1. Example
      6. OnGUI
        1. Example
      7. OnDrawGizmos
        1. Example
          1. Reference
    17. B. Coroutines and Yield
      1. YieldInstruction
        1. Example
        2. Example
      2. WaitForSeconds
        1. Example
      3. WaitForFixedUpdate
        1. Example
      4. Coroutine
        1. Example
      5. StartCoroutine
        1. Using StartCoroutine with method name (string)
      6. StopCoroutine
        1. Example
      7. StopAllCoroutines
        1. Example
          1. Reference
        2. More details
    18. C. Major Differences between C# and Unity JavaScript
      1. Unity Script Directives
      2. Type names
      3. Variable declaration
      4. Variable with Dynamic Type Resolution
      5. Multi-dimensional array declaration
      6. Character literals not supported
      7. Class declarations
      8. Limited interface support
      9. Generics
      10. The foreach keyword
      11. The new keyword
      12. YieldInstruction and coroutine
      13. Casting
      14. Properties with getters/setters
      15. Changing Struct properties by value VS by reference
      16. Function/method definitions
      17. Reference
    19. D. Shaders and Cg/HLSL Programming
      1. ShaderLab properties
        1. Example
      2. Surface shaders
        1. #pragma surface
          1. Required parameters
        2. Surface shaders input structure
          1. Example:
        3. SurfaceOutput structure
      3. Cg/HLSL programming
        1. Accessing shader properties in Cg/HLSL
          1. Example:
        2. Data type
        3. Common methods to create shaders
      4. Reference
    20. Index