Unity in action : multiplatform game development in C♯ / Joseph Hocking.

by Hocking, Joseph, 1979- [author.]Looking glass; Schell, Jesse [author of introduction, etc.]Looking glass.

Publisher: Shelter Island, New York : Manning, [2015]Description: xxiii, 326 pages : illustrations (black and white) ; 24 cm.ISBN: 9781617292323; 161729232X.Subject(s): C# (Computer program language)Looking glass | Computer games -- ProgrammingLooking glass | Computer games -- DesignLooking glass | Software frameworksLooking glass
Contents:
Part 1. First steps -- Getting to know Unity -- Building a demo that puts you in 3D space -- Adding enemies and projectiles to the 3D game -- Developing graphics for your game -- Part 2. Getting comfortable -- Building a Memory game using Unity's new 2D functionality -- Putting a 2D GUI in a 3D game -- Creating a third-person 3D game : player movement and animation -- Adding interactive devices and items within the game -- Part 3. Strong finish -- Connecting your game to the internet -- Playing audio : sound effects and music -- Putting the parts together into a complete game -- Deploying your game to players' devices.
Note: "Covers Unity 5.0"-- Cover.;
"Foreword by Jesse Schell"-- Cover.
Note: Includes bibliographical references (pages 316-318) and index. Summary: "Unity in Action teaches you how to write and deploy games. You'll master the Unity toolset from the ground up, adding the skills you need to go from application coder to game developer. Each sample project illuminates specific Unity features and game development strategies. As you read and practice, you'll build up a well-rounded skill set for creating graphically driven 2D and 3D game applications."-- Back cover.
Item type Home library Collection Class number Status Date due Barcode Item reservations
Long loan London College of Communication
Main collection
Printed books 794.81526 HOC (Browse shelf (Opens below)) Available 54202666
Total reservations: 0

Enhanced descriptions from Syndetics:

Summary

Unity in Action teaches you how to write and deploy games. You'll master the Unity toolset from the ground up, adding the skills you need to go from application coder to game developer. Based on Unity version 5.

Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications.

About the Book

This book helps readers build successful games with the Unity game development platform. You will use the powerful C# language, Unity's intuitive workflow tools, and a state-of-the-art rendering engine to build and deploy mobile, desktop, and console games. Unity's single codebase approach minimizes inefficient switching among development tools and concentrates your attention on making great interactive experiences.

Unity in Action teaches you how to write and deploy games. You'll master the Unity toolset from the ground up, adding the skills you need to go from application coder to game developer. Each sample project illuminates specific Unity features and game development strategies. As you read and practice, you'll build up a well-rounded skill set for creating graphically driven 2D and 3D game applications.

You'll need to know how to program, in C# or a similar OO language. No previous Unity experience or game development knowledge is assumed.

What's Inside

Program characters that run, jump, and interact Build code architectures that manage the game's state Connect your games to the internet to download live data Deploy games to platforms including web and mobile Covers Unity 5

About the Author

Joe Hocking is a software engineer specializing in interactive media development. He works for Synapse Games and teaches classes in game development at Columbia College Chicago.

Table of Contents

PART 1 FIRST STEPS Getting to know Unity Building a demo that puts you in 3D space Adding enemies and projectiles to the 3D game Developing graphics for your game PART 2 GETTING COMFORTABLE Building a Memory game using Unity's new 2D functionality Putting a 2D GUI in a 3D game Creating a third-person 3D game: player movement and animation Adding interactive devices and items within the game PART 3 STRONG FINISH Connecting your game to the internet Playing audio: sound effects and music Putting the parts together into a complete game Deploying your game to players' devices

"Covers Unity 5.0"-- Cover.

"Foreword by Jesse Schell"-- Cover.

Includes bibliographical references (pages 316-318) and index.

Part 1. First steps -- Getting to know Unity -- Building a demo that puts you in 3D space -- Adding enemies and projectiles to the 3D game -- Developing graphics for your game -- Part 2. Getting comfortable -- Building a Memory game using Unity's new 2D functionality -- Putting a 2D GUI in a 3D game -- Creating a third-person 3D game : player movement and animation -- Adding interactive devices and items within the game -- Part 3. Strong finish -- Connecting your game to the internet -- Playing audio : sound effects and music -- Putting the parts together into a complete game -- Deploying your game to players' devices.

"Unity in Action teaches you how to write and deploy games. You'll master the Unity toolset from the ground up, adding the skills you need to go from application coder to game developer. Each sample project illuminates specific Unity features and game development strategies. As you read and practice, you'll build up a well-rounded skill set for creating graphically driven 2D and 3D game applications."-- Back cover.

Table of contents provided by Syndetics

  • Foreword (p. xv)
  • Preface (p. xvii)
  • Acknowledgments (p. xix)
  • About this book (p. xx)
  • Part 1 First Steps (p. 1)
  • 1 Getting to know Unity (p. 3)
  • 1.1 Why is Unity so great? (p. 4)
  • Unity's strengths and advantages (p. 4)
  • Downsides to be aware of (p. 6)
  • Example games built with Unity (p. 7)
  • 1.2 How to use Unity (p. 9)
  • Scene view, Game view, and the Toolbar (p. 10)
  • Using the mouse and keyboard (p. 11)
  • The Hierarchy tab and the Inspector (p. 12)
  • The Project and Console tabs (p. 13)
  • 1.3 Getting up and running with Unity programming (p. 14)
  • How code runs in Unity: script components (p. 15)
  • Using MonoDevelop, the cross-platform IDE (p. 16)
  • Printing to the ' console: Hello World! (p. 17)
  • 1.4 Summary (p. 20)
  • 2 Building a demo that puts you in 3D space (p. 21)
  • 2.1 Before you start... (p. 22)
  • Planning the project (p. 22)
  • Understanding 3D coordinate space (p. 23)
  • 2.2 Begin the project: place objects in the scene (p. 25)
  • The scenery: floor, outer walls, inner walls (p. 25)
  • Lights and cameras (p. 27)
  • The player's collider and viewpoint (p. 29)
  • 2.3 Making things move: a script that applies transforms (p. 30)
  • Diagramming how movement is programmed (p. 30)
  • Writing code to implement the diagram (p. 31)
  • Local vs. global coordinate space (p. 32)
  • 2.4 Script component for looking around: MouseLook (p. 33)
  • Horizontal rotation that tracks mouse movement (p. 35)
  • Vertical rotation with limits (p. 35)
  • Horizontal and vertical rotation at the same time (p. 38)
  • 2.5 Keyboard input component: first-person controls (p. 40)
  • Responding to hey presses (p. 40)
  • Setting a rate of movement independent of the computer's speed (p. 41)
  • Moving the CharacterControllerfor collision detection (p. 42)
  • Adjusting components for walking instead of flying (p. 43)
  • 2.6 Summary (p. 45)
  • 3 Adding enemies and projectiles to the 3D game (p. 46)
  • 3.1 Shooting via raycasts (p. 47)
  • What is ray casting? (p. 47)
  • Using the command ScreenPointToRay for shooting (p. 48)
  • Adding visual indicators for aiming and hits (p. 50)
  • 3.2 Scripting reactive targets (p. 53)
  • Determining what was hit (p. 53)
  • Alert the target that it was hit (p. 54)
  • 3.3 Basic wandering Al (p. 55)
  • Diagramming how basic Al works (p. 56)
  • "Seeing" obstacles with a raycast (p. 56)
  • Tracking the character's state (p. 58)
  • 3.4 Spawning enemy prefabs (p. 60)
  • What is a prefab? (p. 60)
  • Creating the enemy prefab (p. 60)
  • Instantiating from an invisible SceneController (p. 61)
  • 3.5 Shooting via instantiating objects (p. 63)
  • Creating the projectile prefab (p. 64)
  • Shooting the projectile and colliding with a target (p. 65)
  • Damaging the player (p. 67)
  • 3.6 Summary (p. 68)
  • 4 Developing graphics for your game (p. 69)
  • 4.1 Understanding art assets (p. 69)
  • 4.2 Building basic 3D scenery: whiteboxing (p. 72)
  • Whiteboxing explained (p. 72)
  • Drawing a floor plan for the level (p. 73)
  • Laying out primitives according to the plan (p. 74)
  • 4.3 Texture the scene with 2D images (p. 75)
  • Choosing a file format (p. 76)
  • Importing an image file (p. 77)
  • Applying the image (p. 78)
  • 4.4 Generating sky visuals using texture images (p. 80)
  • What is a skybox? (p. 80)
  • Creating a new skybox material (p. 81)
  • 4.5 Working with custom 3D models (p. 83)
  • Which file format to choose (p. 83)
  • Exporting and importing the model (p. 84)
  • 4.6 Creating effects using particle systems (p. 86)
  • Adjusting parameters on the default effect (p. 87)
  • Applying a new texture for fire (p. 88)
  • Attaching particle effects to 3D objects (p. 90)
  • 4.7 Summary (p. 91)
  • Part 2 Getting Comfortable (p. 93)
  • 5 Building a Memory game using Unity's new 2D functionality (p. 95)
  • 5.1 Setting everything up for 2D graphics (p. 96)
  • Preparing the project (p. 97)
  • Displaying 2D images (aha sprites) (p. 98)
  • Switching the camera to 2D mode (p. 101)
  • 5.2 Building a card object and making it react to clicks (p. 102)
  • Building the object out of sprites (p. 102)
  • Mouse input code (p. 103)
  • Revealing the card on click (p. 104)
  • 5.3 Displaying the various card images (p. 104)
  • Loading images programmatically (p. 104)
  • Setting the image from an invisible SceneController (p. 105)
  • Instantiating a grid of cards (p. 107)
  • Shuffling the cards (p. 109)
  • 5.4 Making and scoring matches (p. 110)
  • Storing and comparing revealed cards (p. 111)
  • Hiding mismatched cards (p. 111)
  • Text display for the score (p. 112)
  • 5.5 Restart button (p. 114)
  • Programming a UIButton component using SendMessage (p. 115)
  • Calling LoadLevel from SceneController (p. 117)
  • 5.6 Summary (p. 118)
  • 6 Putting a 2D GUI in a 3D game (p. 119)
  • 6.1 Before you start writing code... (p. 121)
  • Immediate mode GUI or advanced 2D interface? (p. 121)
  • Planning the layout (p. 122)
  • Importing UI images (p. 122)
  • 6.2 Setting up the GUI display (p. 123)
  • Creating a canvas for the interface (p. 123)
  • Buttons, images, and text labels (p. 124)
  • Controlling the position of UI elements (p. 127)
  • 6.3 Programming interactivity in the UI (p. 128)
  • Programming an invisible UlController (p. 129)
  • Creating a pop-up window (p. 131)
  • Setting values using sliders and input fields (p. 133)
  • 6.4 Updating the game by responding to events (p. 135)
  • Integrating an event system (p. 136)
  • Broadcasting and listening for events from the scene (p. 137)
  • Broadcasting and listening for events from the HUD (p. 138)
  • 6.5 Summary (p. 139)
  • 7 Creating a third-person 3D game: player movement and animation (p. 140)
  • 7.1 Adjusting the camera view for third-person (p. 142)
  • Importing a character to look at (p. 142)
  • Adding shadows to the scene (p. 144)
  • Orbiting the camera around the player character (p. 145)
  • 7.2 Programming camera-relative movement controls (p. 148)
  • Rotating the character to face movement direction (p. 149)
  • Moving forward in that direction (p. 151)
  • 7.3 Implementing the jump action (p. 152)
  • Applying vertical speed and acceleration (p. 153)
  • Modifying the ground detection to handle edges and slopes (p. 154)
  • 7.4 Setting up animations on the player character (p. 158)
  • Defining animation clips in the imported model (p. 160)
  • Creating the animator controller for these animations (p. 162)
  • Writing code that operates the animator (p. 165)
  • 7.5 Summary (p. 166)
  • 8 Adding interactive devices and items within the game (p. 167)
  • 8.1 Creating doors and other devices (p. 168)
  • Doors that open and close on a keypress (p. 168)
  • Checking distance and facing before opening the door (p. 170)
  • Operating a color-changing monitor (p. 171)
  • 8.2 Interacting with objects by bumping into them (p. 172)
  • Colliding with physics-enabled obstacles (p. 173)
  • Triggering the door with a pressure plate (p. 174)
  • Collecting items scattered around the level (p. 176)
  • 8.3 Managing inventory data and game state (p. 178)
  • Selling up player and inventory managers (p. 178)
  • Programming the game managers (p. 180)
  • Storing inventory in a collection object: List vs. Dictionary (p. 184)
  • 8.4 Inventory UI for using and equipping items (p. 186)
  • Displaying inventory items in the UI (p. 186)
  • Equipping a key to use on locked doors (p. 188)
  • Restoring the player's health by consuming health packs (p. 190)
  • 8.5 Summary (p. 191)
  • Part 3 Strong Finish (p. 193)
  • 9 Connecting your game to the internet (p. 195)
  • 9.1 Creating an outdoor scene (p. 197)
  • Generating sky visuals using a skybox (p. 197)
  • Setting up an atmosphere that's controlled by code (p. 198)
  • 9.2 Downloading weather data from an internet service (p. 201)
  • Requesting WWW data using coroutines (p. 203)
  • Parsing XML (p. 207)
  • Parsing JSON (p. 209)
  • Affecting the scene based on Weather Data (p. 210)
  • 9.3 Adding a networked billboard (p. 212)
  • Loading images from the internet (p. 212)
  • Displaying images on the billboard (p. 214)
  • Caching the downloaded image for reuse (p. 216)
  • 9.4 Posting data to a web server (p. 217)
  • Tracking current weather: sending post requests (p. 218)
  • Server-side code in PHP (p. 220)
  • 9.5 Summary (p. 221)
  • 10 Playing audio: sound effects and music (p. 222)
  • 10.1 Importing sound effects (p. 223)
  • Supported file formats (p. 223)
  • Importing audio files (p. 225)
  • 10.2 Playing sound effects (p. 226)
  • Explaining what's involved: audio clip vs. source, vs. listener (p. 226)
  • Assigning a looping sound (p. 228)
  • Triggering sound effects from code (p. 229)
  • 10.3 Audio control interface (p. 230)
  • Setting up the central AudioManager (p. 230)
  • Volume control UI (p. 232)
  • Playing UI sounds (p. 236)
  • 10.4 Background music (p. 236)
  • Playing music loops (p. 237)
  • Controlling music volume separately (p. 240)
  • Fading between songs (p. 242)
  • 10.5 Summary (p. 245)
  • 11 Putting the parts together into a complete game (p. 246)
  • 11.1 Building an action RPG by repurposing projects (p. 247)
  • Assembling assets and code from multiple projects (p. 248)
  • Programming point-and-click controls: movement and devices (p. 250)
  • Replacing the old GUI with a new interface (p. 255)
  • 11.2 Developing the overarching game structure (p. 261)
  • Controlling mission flow and multiple levels (p. 262)
  • Completing a level by reaching the exit (p. 265)
  • Losing the level when caught by enemies (p. 268)
  • 11.3 Handling the player's progression through the game (p. 269)
  • Saving and loading the player's progress (p. 269)
  • Beating the game by completing three levels (p. 273)
  • 11.4 Summary (p. 275)
  • 12 Deploying your game to players' devices (p. 276)
  • 12.1 Start by building for the desktop: Windows, Mac, and Linux (p. 278)
  • Building the application (p. 279)
  • Adjusting Player Settings: setting the game's name and icon (p. 280)
  • Platform-dependent compilation (p. 281)
  • 12.2 Building for the web (p. 282)
  • Unity Player vs. HTML5/WebGL (p. 282)
  • Building the Unity file and a test web page (p. 282)
  • Communicating with JavaScript in the browser (p. 283)
  • 12.3 Building for mobile apps: iOS and Android (p. 285)
  • Setting up the build tools (p. 286)
  • Texture compression (p. 289)
  • Developing plug-ins (p. 290)
  • 12.4 Summary (p. 298)
  • Afterword (p. 299)
  • Appendix A Scene navigation and keyboard shortcuts (p. 302)
  • Appendix B External tools used alongside Unity (p. 304)
  • Appendix C Modeling a bench in Blender (p. 308)
  • Appendix D Online learning resources (p. 316)
  • Index (p. 319)

Author notes provided by Syndetics

Joe Hocking is a software engineer specializing in interactive media development. He works for Synapse Games and teaches classes in game development at Columbia College Chicago.

Footer