Unity in Action: Multiplatform game development in C#
Summary

Manning's bestselling and highly recommended Unity book has been fully revised! Unity in Action, Second Edition teaches you to write and deploy games with the Unity game development platform. You'll master the Unity toolset from the ground up, adding the skills you need to go from application coder to game developer.

Foreword by Jesse Schell, author of The Art of Game Design

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

About the Technology

Build your next game without sweating the low-level details. The Unity game development platform handles the heavy lifting, so you can focus on game play, graphics, and user experience. With support for C# programming, a huge ecosystem of production-quality prebuilt assets, and a strong dev community, Unity can get your next great game idea off the drawing board and onto the screen!

About the Book

Unity in Action, Second Edition teaches you to write and deploy games with Unity. As you explore the many interesting examples, you'll get hands-on practice with Unity's intuitive workflow tools and state-of-the-art rendering engine. This practical guide exposes every aspect of the game dev process, from the initial groundwork to creating custom AI scripts and building easy-to-read UIs. And because you asked for it, this totally revised Second Edition includes a new chapter on building 2D platformers with Unity's expanded 2D toolkit.

What's Inside

  • Revised for new best practices, updates, and more!
  • 2D and 3D games
  • Characters that run, jump, and bump into things
  • Connect your games to the internet

About the Reader

You need to know C# or a similar language. No game development knowledge is assumed.

About the Author

Joe Hocking is a software engineer and Unity expert specializing in interactive media development.

Table of Contents

  1. Getting to know Unity
  2. Building a demo that puts you in 3D space
  3. Adding enemies and projectiles to the 3D game
  4. Developing graphics for your game
  5. Building a Memory game using Unity's 2D functionality
  6. Creating a basic 2D Platformer
  7. Putting a GUI onto a game
  8. Creating a third-person 3D game: player movement and animation
  9. Adding interactive devices and items within the game
  10. Connecting your game to the internet
  11. Playing audio: sound effects and music
  12. Putting the parts together into a complete game
  13. Deploying your game to players' devices
"1120875692"
Unity in Action: Multiplatform game development in C#
Summary

Manning's bestselling and highly recommended Unity book has been fully revised! Unity in Action, Second Edition teaches you to write and deploy games with the Unity game development platform. You'll master the Unity toolset from the ground up, adding the skills you need to go from application coder to game developer.

Foreword by Jesse Schell, author of The Art of Game Design

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

About the Technology

Build your next game without sweating the low-level details. The Unity game development platform handles the heavy lifting, so you can focus on game play, graphics, and user experience. With support for C# programming, a huge ecosystem of production-quality prebuilt assets, and a strong dev community, Unity can get your next great game idea off the drawing board and onto the screen!

About the Book

Unity in Action, Second Edition teaches you to write and deploy games with Unity. As you explore the many interesting examples, you'll get hands-on practice with Unity's intuitive workflow tools and state-of-the-art rendering engine. This practical guide exposes every aspect of the game dev process, from the initial groundwork to creating custom AI scripts and building easy-to-read UIs. And because you asked for it, this totally revised Second Edition includes a new chapter on building 2D platformers with Unity's expanded 2D toolkit.

What's Inside

  • Revised for new best practices, updates, and more!
  • 2D and 3D games
  • Characters that run, jump, and bump into things
  • Connect your games to the internet

About the Reader

You need to know C# or a similar language. No game development knowledge is assumed.

About the Author

Joe Hocking is a software engineer and Unity expert specializing in interactive media development.

Table of Contents

  1. Getting to know Unity
  2. Building a demo that puts you in 3D space
  3. Adding enemies and projectiles to the 3D game
  4. Developing graphics for your game
  5. Building a Memory game using Unity's 2D functionality
  6. Creating a basic 2D Platformer
  7. Putting a GUI onto a game
  8. Creating a third-person 3D game: player movement and animation
  9. Adding interactive devices and items within the game
  10. Connecting your game to the internet
  11. Playing audio: sound effects and music
  12. Putting the parts together into a complete game
  13. Deploying your game to players' devices
44.99 In Stock
Unity in Action: Multiplatform game development in C#

Unity in Action: Multiplatform game development in C#

by Joe Hocking
Unity in Action: Multiplatform game development in C#

Unity in Action: Multiplatform game development in C#

by Joe Hocking

Paperback(2nd Edition)

$44.99 
  • SHIP THIS ITEM
    Qualifies for Free Shipping
  • PICK UP IN STORE
    Check Availability at Nearby Stores

Related collections and offers


Overview

Summary

Manning's bestselling and highly recommended Unity book has been fully revised! Unity in Action, Second Edition teaches you to write and deploy games with the Unity game development platform. You'll master the Unity toolset from the ground up, adding the skills you need to go from application coder to game developer.

Foreword by Jesse Schell, author of The Art of Game Design

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

About the Technology

Build your next game without sweating the low-level details. The Unity game development platform handles the heavy lifting, so you can focus on game play, graphics, and user experience. With support for C# programming, a huge ecosystem of production-quality prebuilt assets, and a strong dev community, Unity can get your next great game idea off the drawing board and onto the screen!

About the Book

Unity in Action, Second Edition teaches you to write and deploy games with Unity. As you explore the many interesting examples, you'll get hands-on practice with Unity's intuitive workflow tools and state-of-the-art rendering engine. This practical guide exposes every aspect of the game dev process, from the initial groundwork to creating custom AI scripts and building easy-to-read UIs. And because you asked for it, this totally revised Second Edition includes a new chapter on building 2D platformers with Unity's expanded 2D toolkit.

What's Inside

  • Revised for new best practices, updates, and more!
  • 2D and 3D games
  • Characters that run, jump, and bump into things
  • Connect your games to the internet

About the Reader

You need to know C# or a similar language. No game development knowledge is assumed.

About the Author

Joe Hocking is a software engineer and Unity expert specializing in interactive media development.

Table of Contents

  1. Getting to know Unity
  2. Building a demo that puts you in 3D space
  3. Adding enemies and projectiles to the 3D game
  4. Developing graphics for your game
  5. Building a Memory game using Unity's 2D functionality
  6. Creating a basic 2D Platformer
  7. Putting a GUI onto a game
  8. Creating a third-person 3D game: player movement and animation
  9. Adding interactive devices and items within the game
  10. Connecting your game to the internet
  11. Playing audio: sound effects and music
  12. Putting the parts together into a complete game
  13. Deploying your game to players' devices

Product Details

ISBN-13: 9781617294969
Publisher: Manning
Publication date: 04/25/2018
Edition description: 2nd Edition
Pages: 400
Sales rank: 1,118,650
Product dimensions: 7.30(w) x 9.20(h) x 1.00(d)

About the Author

Joe Hocking is a software engineer who specializes in interactive media development. He currently works for Qualcomm, wrote most of the third edition while working for BUNDLAR, and wrote the first edition while at Synapse Games. He has also taught classes at the University of Illinois Chicago, the School of the Art Institute of Chicago, and Columbia College Chicago. He lives in the Chicago suburbs with his wife and two kids. His website is www.newarteest.com.

Table of Contents

Foreword xv

Preface xvii

Acknowledgments xix

About this book xxi

About the author xxv

About the cover illustration xxvii

Part 1 First Steps 1

1 Getting to know Unity 3

1.1 Why is Unity so great? 4

Unity's strengths and advantages 4

Downsides to be aware of 7

Example games built with Unity 7

1.2 How to use Unity 12

Scene view, Game view, and the Toolbar 13

Using the mouse and keyboard 14

The Hierarchy view and the Inspector panel 15

The Project and Console tabs 16

1.3 Getting up and running with Unity programming 17

How code runs in Unity: script components 18

Using MonoDevelop, the cross-platform IDE 19

Printing to the console: Hello World! 21

2 Building a demo that puts you in 3D space 24

2.1 Before you start … 25

Planning the project 25

Understanding 3D coordinate space 26

2.2 Begin the project: place objects in the scene 28

The scenery: floor, outer walls, and inner walls 29

Lights and cameras 31

The player's collider and viewpoint 33

2.3 Making things move: a script that applies transforms 34

Visualizing how movement is programmed 34

Writing code to implement the diagram 34

Local vs. global coordinate space 36

2.4 Script component for looking around: MouseLook 37

Horizontal rotation that tracks mouse movement 38

Vertical rotation with limits 39

Horizontal and vertical rotation at the same time 41

2.5 Keyboard input component: first-person controls 44

Responding to keypresses 44

Setting a rate of movement independent of the computer's speed 45

Moving the CharacterController for collision detection 46

Adjusting components for walking instead of flying 47

3 Adding enemies and projectiles to the 3D game 50

3.1 Shooting via raycasts 51

What is ray casting? 51

Using the ScreenPointToRay command for shooting 52

Adding visual indicators for aiming and hits 54

3.2 Scripting reactive targets 57

Determining what was hit 57

Aiming the target that it was hit 58

3.3 Basic wandering AI 60

Diagramming how basic AI works 60

"Seeing" obstacles with a raycast 61

Tracking the character's state 63

3.4 Spawning enemy prefabs 64

What is a prefab? 64

Creating the enemy prefab 65

Instantiating from an invisible SceneController 66

3.5 Shooting by instantiating objects 68

Creating the projectile prefab 68

Shooting the projectile and colliding with a target 70

Damaging the player 72

4 Developing graphics for your game 74

4.1 Understanding art assets 74

4.2 Building basic 3D scenery: whiteboxing 77

Whiteboxing explained 78

Drawing a floor plan for the level 78

Laying out primitives according to the plan 79

4.3 Texture the scene with 2D images 81

Choosing a file format 82

Importing an image file 83

Applying the image 84

4.4 Generating sky visuals using texture images 86

What is a skybox? 86

Creating a new skybox material 87

4.5 Working with custom 3D models 89

Which file format to choose? 90

Exporting and importing the model 91

4.6 Creating effects using particle systems 94

Adjusting parameters on the default effect 95

Applying a new texture for fire 95

Attaching particle effects to 3D objects 98

Part 2 Getting Comfortable 101

5 Building a Memory game using Unity's 2D functionality 103

5.1 Setting everything up for 2D graphics 104

Preparing the project 105

Displaying 2D images (aka sprites) 107

Switching the camera to 2D mode 108

5.2 Building a card object and making it react to clicks 110

Building the object out of sprites 110

Mouse input code 111

Revealing the card on click 111

5.3 Displaying the various card images 112

Loading images programmatically 112

Setting the image from an invisible SceneController 113

Instantiating a grid of cards 115

Shuffling the cards 117

5.4 Making and scoring matches 118

Storing and comparing revealed cards 119

Hiding mismatched cards 119

Text display for the score 120

5.5 Restart button 122

Programming a UIButton component using SendMessage 123

Calling LoadScene from SceneController 125

Creating a basic 2DPlatfarmer 127

6 Creating a basic 2D platformer 127

6.1 Setting up the graphics 128

Placing the walls and floor 129

Importing sprite sheets 129

6.2 Moving the player left and right 130

Writing keyboard controls 131

Colliding with the walls 132

6.3 Playing the sprite's animation 133

Explaining the Mecanim animation system 133

Triggering animations from code 135

6.4 Adding the ability to jump 136

Falling from gravity 136

Applying an upward impulse 138

Detecting the ground 138

6.5 Additional features for a platform game 139

Unusual floors: slopes and one-way platforms 140

Implementing moving platforms 141

Camera control 144

7 Putting a GUI onto a game 146

7.1 Before you start writing code … 148

Immediate mode GUI or advanced 2D interface? 148

Planning the layout 149

Importing UT images 150

7.2 Setting up the GUI display 150

Creating a canvas for the interface 150

Buttons, images, and text labels 152

Controlling the position of UI elements 154

7.3 Programming interactivity in the UI 156

Programming an invisible UIController 157

Creating a pop-up window 158

Setting values using sliders and input fields 162

7.4 Updating the game by responding to events 164

Integrating an event system 164

Broadcasting and listening for events from the scene 165

Broadcasting and listening for events from the HUD 166

8 Creating a third-person 3D game: player movement and animation 169

8.1 Adjusting the camera view for third-person 172

Importing a character to look at 172

Adding shadows to the scene 173

Orbiting the camera around the player character 175

8.2 Programming camera-relative movement controls 178

Rotating the character to face movement direction 178

Moving forward in that direction 180

8.3 Implementing the jump action 182

Applying vertical speed and acceleration 182

Modifying the ground detection to handle edges and slopes 184

8.4 Setting up animations on the player character 188

Defining animation clips in the imported model 190

Creating the animator controller for these animations 192

Writing code that operates the animator 195

9 Adding interactive devices and items within the game 197

9.1 Creating doors and other devices 198

Doors that open and close on a keypress 198

Checking distance and facing before opening the door 200

Operating a color-changing monitor 202

9.2 Interacting with objects by bumping into them 203

Colliding with physics-enabled obstacles 203

Operating the door with a trigger object 204

Collecting items scattered around the level 207

9.3 Managing inventory data and game state 208

Setting up player and inventory managers 209

Programming the game managers 210

Storing inventory in a collection object: List vs. Dictionary 214

9.4 Inventory UI for using and equipping items 216

Displaying inventory items in the UI 217

Equipping a key to use on locked doors 219

Restoring the player's health by consuming health packs 221

Part 3 Strong Finish 223

10 Connecting your game to the internet 225

10.1 Creating an outdoor scene 227

Generating sky visuals using a sky box 227

Setting up an atmosphere that's controlled by code 228

10.2 Downloading weather data from an internet service 231

Requesting HTTP data using coroutines 234

Parsing XML 237

Parsing JSON 239

Affecting the scene based on weather data 241

10.3 Adding a networked billboard 242

Loading images from the internet 242

Displaying images on the billboard 245

Caching the downloaded image for reuse 246

10.4 Posting data to a web server 248

Tracking current weather: sending post requests 249

Server-side code in PHP 250

11 Playing audio: sound effects and music 252

11.1 Importing sound effects 253

Supported file formats 253

Importing audio files 255

11.2 Playing sound effects 257

Explaining what's involved: Audio Clip vs. Source vs. Listener 257

Assigning a looping sound 258

Triggering sound effects from code 259

11.3 Audio control interface 260

Setting up the central AudioManager 261

Volume control UI 263

Playing XI sounds 266

11.4 Background music 267

Playing music loops 267

Controlling music volume separately 271

Fading between songs 273

12 Putting the parts together into a complete game 276

12.1 Building an action RPG by repurposing projects 277

Assembling assets and code from, multiple projects 278

Programming point-and-click controls: movement and devices 280

Replacing the old GUI with a new interface 285

12.2 Developing the overarching game structure 292

Controlling mission flow and multiple levels 292

Completing a level by reaching the exit 296

Losing the level when caught by enemies 298

12.3 Handling the player's progression through the game 300

Saving and loading the player's progress 300

Beating the game by completing three levels 304

13 Deploying your game to players' devices 307

13.1 Start by building for the desktop: Windows, Mac, and Linux 310

Building the application 310

Adjusting Player Settings: selling the game's name and icon 311

Platform-dependent compilation 312

13.2 Building for the web 314

Unity Player vs. HTML5/WebGL 314

Building the game embedded in a web page 315

Communicating with JavaScript in the browser 315

13.3 Building for mobile: iOS and Android 318

Setting up the build tools 319

Texture compression 323

Developing plug-ins 324

Afterword 333

Appendix A Scene navigation and keyboard shortcuts 336

Appendix B External tools used alongside Unity 338

Appendix C Modeling a bench in Blender 342

Appendix D Online learning resources 351

Index 355

From the B&N Reads Blog

Customer Reviews