0%

Book Description

Develop spectacular gaming content by exploring and utilizing Unity 4

In Detail

Immerse yourself in the world of high-end game design by partaking in challenging missions. Start off by working with the Sprite Mode, then learn the basics of creating a UI system for an RPG, and work your way through the game virtually embodying your greatest hero or heroine.

Every project is designed to push your Unity skills to the limit and beyond. You will start by creating a 2D platform game with the new 2D sprite feature and move on to the Unity GUI system. Then, you will create a 3D character and make it move. By the end of this book, you will know how to post the player's score to the hi-score board.

What You Will Learn

  • Explore 2D Sprite character animation, rigid body, physics raycast, and camera type
  • Create custom UI graphics, scripts, a draggable window, and dynamic UI using the Unity GUI system
  • Code using surface shader programming and learn the basics of shaders
  • Create a rocket launcher, built-in fire particle effect, and custom particle effect
  • Load and save with PlayerPrefs and post the hi-score to the database using PHP and MySQL.

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. Unity 4 Game Development HOTSHOT
    1. Table of Contents
    2. Unity 4 Game Development HOTSHOT
    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
        3. Instant Updates on New Packt Books
    7. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Sections
      5. Mission briefing
        1. Why is it awesome?
        2. Your Hotshot objectives
        3. Mission checklist
      6. Task 1
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mini debriefing
        4. Classified intel
      7. Mission accomplished
      8. A Hotshot challenge / Hotshot challenges
      9. Conventions
      10. Reader feedback
      11. 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. Why is it awesome?
        2. Your Hotshot objectives
        3. Mission checklist
      2. Setting up a 2D level and collider
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mini debriefing
        4. Classified intel
          1. The Sprite Renderer and Sorting Layer
      3. Creating a 2D character and animation
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mini debriefing
        4. Classified intel
      4. Controlling the character with the PlayerController_2D class
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mini debriefing
        4. Classified intel
          1. Physics2D.Raycast
      5. Creating a key, door, and replay button
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mini debriefing
        4. Classified intel
          1. Coroutines
          2. The Restart button
      6. Mission accomplished
      7. Hotshot challenges
    9. 2. Create a Menu for an RPG – Add Powerups, Weapons, and Armors
      1. Mission briefing
        1. Why is it awesome?
        2. Your Hotshot objectives
        3. Mission checklist
      2. Customizing skin with GUISkin
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mini debriefing
        4. Classified intel
      3. Creating a menu object
        1. Engage thrusters
        2. Objective complete – mini debriefing
        3. Classified intel
      4. Creating the STATUS tab
        1. Engage thrusters
        2. Objective complete – mini debriefing
        3. Classified intel
      5. Creating the INVENTORY tab
        1. Engage thrusters
        2. Objective complete – mini debriefing
        3. Classified intel
          1. GUI.tooltip
      6. Creating the EQUIPMENT tab
        1. Engage thrusters
        2. Objective complete – mini debriefing
        3. Classified intel
      7. Mission accomplished
      8. Hotshot challenges
    10. 3. Shade Your Hero/Heroine
      1. Mission briefing
        1. Why is it awesome?
        2. Your Hotshot objectives
        3. Mission checklist
      2. Shader programming – Diffuse and Bump (normal) maps
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mini debriefing
        4. Classified intel
      3. Shader programming – Ambient and Specular light
        1. Engage thrusters
        2. Objective complete – mini debriefing
        3. Classified intel
      4. Shader programming – Half Lambert, Rim Light, and Toon Ramp
        1. Engage thrusters
        2. Objective complete – mini debriefing
      5. Mission accomplished
      6. Hotshot challenges
    11. 4. Add Character Control and Animation to Our Hero/Heroine
      1. Mission briefing
        1. Why is it awesome?
        2. Your Hotshot objectives
        3. 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
          1. Tip for 3Ds Max users
          2. The Animations inspector
      3. Creating an animator controller
        1. Engage thrusters
        2. Objective complete – mini debriefing
        3. Classified intel
      4. Creating a character control script
        1. Engage thrusters
        2. Objective complete – mini debriefing
        3. Classified intel
      5. Creating a third-person camera to follow our character
        1. Engage thrusters
        2. Objective complete – mini debriefing
        3. Classified intel
      6. Mission accomplished
      7. Hotshot challenges
    12. 5. Build a Rocket Launcher!
      1. Mission briefing
        1. Why is it awesome?
        2. Your Hotshot objectives
        3. Mission checklist
      2. Setting up a character animation and animator controller
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mini debriefing
        4. Classified intel
          1. Blend Tree
      3. Adding new features to the CharacterControl and CameraControl scripts
        1. Engage thrusters
        2. Objective complete – mini debriefing
      4. Creating a MouseLook script and laser target scope
        1. Engage thrusters
        2. Objective complete – mini debriefing
        3. Classified intel
          1. Line Renderer
      5. Creating a rocket prefab and particle effects
        1. Engage thrusters
        2. Objective complete – mini debriefing
        3. Classified intel
      6. Creating a rocket launcher and RocketUI
        1. Engage thrusters
        2. Objective complete – mini debriefing
        3. Classified intel
          1. BroadcastMessage
      7. Mission accomplished
      8. Hotshot challenges
    13. 6. Make AI Appear Smart
      1. Mission briefing
        1. Why is it awesome?
        2. Your Hotshot objectives
        3. Mission checklist
      2. Creating the Waypoint and WaypointsContainer scripts
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mini debriefing
        4. Classified intel
          1. Gizmos
      3. Creating a custom editor for the WaypointsContainer script
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mini debriefing
        4. Classified intel
      4. Creating the enemy movement with the AI script
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mini debriefing
        4. Classified intel
      5. Creating a hit-point UI
        1. Engage thrusters
        2. Objective complete – mini debriefing
        3. Classified intel
      6. Mission accomplished
      7. Hotshot challenges
    14. 7. Forge a Destructible and Interactive Virtual World
      1. Mission briefing
        1. Why is it awesome?
        2. Your Hotshot objectives
        3. Mission checklist
      2. Creating a ragdoll object
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mini debriefing
        4. Classified intel
      3. Creating a destructible wall
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mini debriefing
        4. Classified intel
      4. Creating a rockslide and trigger area
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mini debriefing
      5. Creating the RocksTrigger and Rocks scripts
        1. Engage thrusters
        2. Objective complete – mini debriefing
        3. Classified intel
      6. Mission accomplished
      7. Hotshot challenges
    15. 8. Let the World See the Carnage – Saving and Loading High Scores
      1. Mission briefing
        1. Why is it awesome?
        2. Your Hotshot objectives
        3. Mission checklist
      2. Creating the UserData and Hiscore scripts
        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. Engage thrusters
        2. Objective complete – mini debriefing
        3. Classified intel
      4. Creating an XMLParser script
        1. Engage thrusters
        2. Objective complete – mini debriefing
        3. Classified intel
      5. Saving and loading server high score
        1. Prepare for lift off
        2. Engage thrusters
        3. Objective complete – mini debriefing
        4. Classified intel
      6. Mission accomplished
      7. Hotshot challenges
    16. A. Important Functions
      1. Awake()
      2. Start()
      3. Update()
      4. FixedUpdate()
      5. LateUpdate()
      6. OnEnable()
      7. OnDisable()
      8. OnGUI()
      9. OnDrawGizmos()
        1. References
    17. B. Coroutines and Yield
      1. Coroutines
      2. YieldInstruction
      3. WaitForSeconds
      4. WaitForFixedUpdate
      5. StartCoroutine
        1. Using StartCoroutine with method name (string)
      6. StopCoroutine
      7. StopAllCoroutines
        1. References
    18. C. Major Differences Between C# and Unity JavaScript
      1. Unity script directives
      2. Type names
      3. Variable declaration
      4. Variables with dynamically typed resolution
      5. Multidimensional 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. The yield instruction and coroutine
      13. Casting
      14. Properties with getters/setters
      15. Changing struct properties by value versus by reference
      16. Function/method definitions
        1. References
    19. D. Shaders and Cg/HLSL Programming
      1. ShaderLab properties
      2. Surface shaders
        1. #pragma surface
        2. Surface shaders input structure
        3. The SurfaceOutput structure
      3. Cg/HLSL Programming
        1. Accessing shader properties in Cg/HLSL
        2. Data types
        3. Common methods to create shaders
        4. References
    20. Index
3.149.229.253