TY - BOOK AU - Hocking, Joseph TI - Unity in action : : multiplatform game development in C# SN - 9781617299339 AV - QA 76.76.C672 .H63 2022 PY - 2022/// CY - Shelter Island, NY PB - Manning Publications Co., KW - VIDEO GAMES -- DESIGN KW - SOFTWARE FRAMEWORKS N1 - Includes bibliographical references and index; Intro -- inside front cover -- Praise for earlier editions of Unity in Action -- Unity in Action, Third Edition -- Copyright -- contents -- front matter -- foreword -- preface -- acknowledgments -- about this book -- Who should read this book -- How this book is organized: A roadmap -- About the code -- liveBook discussion forum -- about the author -- about the cover illustration -- Part 1 First steps -- 1 Getting to know Unity -- 1.1 Why is Unity so great? -- 1.1.1 Unity's strengths and advantages -- 1.1.2 Downsides to be aware of -- 1.1.3 Example games built with Unity -- 1.2 How to use Unity -- 1.2.1 Scene view, Game view, and the Toolbar -- 1.2.2 The mouse and keyboard -- 1.2.3 The Hierarchy view and the Inspector panel -- 1.2.4 The Project and Console tabs -- 1.3 Getting up and running with Unity programming -- 1.3.1 Running code in Unity: Script components -- 1.3.2 Using Visual Studio, the included IDE -- 1.3.3 Printing to the console: Hello World! -- Summary -- 2 Building a demo that puts you in 3D space -- 2.1 Before you start . . . -- 2.1.1 Planning the project -- 2.1.2 Understanding 3D coordinate space -- 2.2 Begin the project: Place objects in the scene -- 2.2.1 The scenery: Floor, outer walls, and inner walls -- 2.2.2 Lights and cameras -- 2.2.3 The player's collider and viewpoint -- 2.3 Make things move: A script that applies transforms -- 2.3.1 Visualizing how movement is programmed -- 2.3.2 Writing code to implement the diagram -- 2.3.3 Understanding local vs. global coordinate space -- 2.4 Script component for looking around: MouseLook -- 2.4.1 Horizontal rotation that tracks mouse movement -- 2.4.2 Vertical rotation with limits -- 2.4.3 Horizontal and vertical rotation at the same time -- 2.5 Keyboard input component: First-person controls -- 2.5.1 Responding to keypresses. -- 2.5.2 Setting a rate of movement independent of the computer's speed -- 2.5.3 Moving the CharacterController for collision detection -- 2.5.4 Adjusting components for walking instead of flying -- Summary -- 3 Adding enemies and projectiles to the 3D game -- 3.1 Shooting via raycasts -- 3.1.1 What is raycasting? -- 3.1.2 Using the ScreenPointToRay command for shooting -- 3.1.3 Adding visual indicators for aiming and hits -- 3.2 Scripting reactive targets -- 3.2.1 Determining what was hit -- 3.2.2 Alerting the target that it was hit -- 3.3 Basic wandering AI -- 3.3.1 Diagramming how basic AI works -- 3.3.2 "Seeing" obstacles with a raycast -- 3.3.3 Tracking the character's state -- 3.4 Spawning enemy prefabs -- 3.4.1 What is a prefab? -- 3.4.2 Creating the enemy prefab -- 3.4.3 Instantiating from an invisible SceneController -- 3.5 Shooting by instantiating objects -- 3.5.1 Creating the projectile prefab -- 3.5.2 Shooting the projectile and colliding with a target -- 3.5.3 Damaging the player -- Summary -- 4 Developing graphics for your game -- 4.1 Understanding art assets -- 4.2 Building basic 3D scenery: Whiteboxing -- 4.2.1 Whiteboxing explained -- 4.2.2 Drawing a floor plan for the level -- 4.2.3 Laying out primitives according to the plan -- 4.3 Texturing the scene with 2D images -- 4.3.1 Choosing a file format -- 4.3.2 Importing an image file -- 4.3.3 Applying the image -- 4.4 Generating sky visuals by using texture images -- 4.4.1 What is a skybox? -- 4.4.2 Creating a new skybox material -- 4.5 Working with custom 3D models -- 4.5.1 Which file format to choose? -- 4.5.2 Exporting and importing the model -- 4.6 Creating effects by using particle systems -- 4.6.1 Adjusting parameters on the default effect -- 4.6.2 Applying a new texture for fire -- 4.6.3 Attaching particle effects to 3D objects -- Summary -- Part 2 Getting comfortable. -- 5 Building a Memory game using Unity's 2D functionality -- 5.1 Setting up everything for 2D graphics -- 5.1.1 Preparing the project -- 5.1.2 Displaying 2D images (aka sprites) -- 5.1.3 Switching the camera to 2D mode -- 5.2 Building a card object and making it react to clicks -- 5.2.1 Building the object out of sprites -- 5.2.2 Mouse input code -- 5.2.3 Revealing the card on a click -- 5.3 Displaying the various card images -- 5.3.1 Loading images programmatically -- 5.3.2 Setting the image from an invisible SceneController -- 5.3.3 Instantiating a grid of cards -- 5.3.4 Shuffling the cards -- 5.4 Making and scoring matches -- 5.4.1 Storing and comparing revealed cards -- 5.4.2 Hiding mismatched cards -- 5.4.3 Text display for the score -- 5.5 Restart button -- 5.5.1 Programming a UIButton component by using SendMessage -- 5.5.2 Calling LoadScene from SceneController -- Summary -- 6 Creating a basic 2D platformer -- 6.1 Setting up the graphics -- 6.1.1 Placing the scenery -- 6.1.2 Importing sprite sheets -- 6.2 Moving the player left and right -- 6.2.1 Writing keyboard controls -- 6.2.2 Colliding with the block -- 6.3 Playing the sprite's animation -- 6.3.1 Explaining the Mecanim animation system -- 6.3.2 Triggering animations from code -- 6.4 Adding the ability to jump -- 6.4.1 Falling from gravity -- 6.4.2 Applying an upward impulse -- 6.4.3 Detecting the ground -- 6.5 Additional features for a platform game -- 6.5.1 Unusual floors: Slopes and one-way platforms -- 6.5.2 Implementing moving platforms -- 6.5.3 Camera control -- Summary -- 7 Putting a GUI onto a game -- 7.1 Before you start writing code . . . -- 7.1.1 Immediate mode GUI or advanced 2D interface? -- 7.1.2 Planning the layout -- 7.1.3 Importing UI images -- 7.2 Setting up the GUI display -- 7.2.1 Creating a canvas for the interface -- 7.2.2 Buttons, images, and text labels. -- 7.2.3 Controlling the position of UI elements -- 7.3 Programming interactivity in the UI -- 7.3.1 Programming an invisible UIController -- 7.3.2 Creating a pop-up window -- 7.3.3 Setting values using sliders and input fields -- 7.4 Updating the game by responding to events -- 7.4.1 Integrating an event system -- 7.4.2 Broadcasting and listening for events from the scene -- 7.4.3 Broadcasting and listening for events from the HUD -- Summary -- 8 Creating a third-person 3D game: Player movement and animation -- 8.1 Adjusting the camera view for third-person -- 8.1.1 Importing a character to look at -- 8.1.2 Adding shadows to the scene -- 8.1.3 Orbiting the camera around the player character -- 8.2 Programming camera-relative movement controls -- 8.2.1 Rotating the character to face movement direction -- 8.2.2 Moving forward in that direction -- 8.3 Implementing the jump action -- 8.3.1 Applying vertical speed and acceleration -- 8.3.2 Modifying the ground detection to handle edges and slopes -- 8.4 Setting up animations on the player character -- 8.4.1 Defining animation clips in the imported model -- 8.4.2 Creating the animator controller for these animations -- 8.4.3 Writing code that operates the animator -- Summary -- 9 Adding interactive devices and items within the game -- 9.1 Creating doors and other devices -- 9.1.1 Doors that open and close on a keypress -- 9.1.2 Checking distance and facing before opening the door -- 9.1.3 Operating a color-changing monitor -- 9.2 Interacting with objects by bumping into them -- 9.2.1 Colliding with physics-enabled obstacles -- 9.2.2 Operating the door with a trigger object -- 9.2.3 Collecting items scattered around the level -- 9.3 Managing inventory data and game state -- 9.3.1 Setting up player and inventory managers -- 9.3.2 Programming the game managers. -- 9.3.3 Storing inventory in a collection object: List vs. Dictionary -- 9.4 Inventory UI for using and equipping items -- 9.4.1 Displaying inventory items in the UI -- 9.4.2 Equipping a key to use on locked doors -- 9.4.3 Restoring the player's health by consuming health packs -- Summary -- Part 3 Strong finish -- 10 Connecting your game to the internet -- 10.1 Creating an outdoor scene -- 10.1.1 Generating sky visuals by using a skybox -- 10.1.2 Setting up an atmosphere that's controlled by code -- 10.2 Downloading weather data from an internet service -- 10.2.1 Requesting HTTP data using coroutines -- 10.2.2 Parsing XML -- 10.2.3 Parsing JSON -- 10.2.4 Affecting the scene based on weather data -- 10.3 Adding a networked billboard -- 10.3.1 Loading images from the internet -- 10.3.2 Displaying images on the billboard -- 10.3.3 Caching the downloaded image for reuse -- 10.4 Posting data to a web server -- 10.4.1 Tracking current weather: Sending post requests -- 10.4.2 Server-side code in PHP -- Summary -- 11 Playing audio: Sound effects and music -- 11.1 Importing sound effects -- 11.1.1 Supported file formats -- 11.1.2 Importing audio files -- 11.2 Playing sound effects -- 11.2.1 Explaining what's involved: Audio clip vs. source vs. listener -- 11.2.2 Assigning a looping sound -- 11.2.3 Triggering sound effects from code -- 11.3 Using the audio control interface -- 11.3.1 Setting up the central AudioManager -- 11.3.2 Volume control UI -- 11.3.3 Playing UI sounds -- 11.4 Adding background music -- 11.4.1 Playing music loops -- 11.4.2 Controlling music volume separately -- 11.4.3 Fading between songs -- Summary -- 12 Putting the parts together into a complete game -- 12.1 Building an action RPG by repurposing projects -- 12.1.1 Assembling assets and code from multiple projects -- 12.1.2 Programming point-and-click controls: Movement and devices. -- 12.1.3 Replacing the old GUI with a new interface N2 - Unity in Action, Third Edition teaches you to create games with the Unity game platform. It's many 2D, 3D, and AR/VR game examples give you hands-on experience with Unity's workflow tools and state-of-the-art rendering engine. This fully updated third edition presents new coverage of Unity's XR toolkit and shows you how you can start building with virtual and augmented reality ER -