Reader small image

You're reading from  Unity Cookbook - Fifth Edition

Product typeBook
Published inNov 2023
Reading LevelIntermediate
PublisherPackt
ISBN-139781805123026
Edition5th Edition
Languages
Tools
Right arrow
Authors (3):
Shaun Ferns
Shaun Ferns
author image
Shaun Ferns

Shaun is a lecturer at Technological University Dublin. He is currently teaching on the BA (Hons) in Creative Digital Media where he is lead in the delivery of the Multimedia Stream. He is currently exploring serious games for construction-related training as well as the opportunities transmedia provides in improving user experience and engagement in cultural archive artifacts. His educational research is currently driven by his interest in self-determined learning (heutagogy), rhizomatic learning theory, micro-credentialing /digital badging, and curriculum development.
Read more about Shaun Ferns

Sinéad Murphy
Sinéad Murphy
author image
Sinéad Murphy

Sinead Murphy is currently Data Analytics Manager for the Irish NGO Trocaire. She has over 25 years of computing experience, including freelance IT training and database consulting, university lecturing in mathematics, IT skills and programming at TU Dublin (Ireland) and Middlesex University (London). She is a published academic, with undergraduate and postgraduate degrees in mathematics, computing and data science. She is passionate about the use of IT for understanding and visualising data, and using that understanding to make meaningful differences in the world. She is currently exploring the use of Python and Unity for data analytics and interactive visualisations.
Read more about Sinéad Murphy

View More author details
Right arrow

What this book covers

Chapter 1, Displaying Data with Core UI Elements, is filled with User Interface (UI) recipes to help you increase the entertainment and enjoyment value of your games through the quality of the visual elements displaying text and data. You’ll learn a wide range of UI techniques for displaying text and images.

Chapter 2, Responding to User Events for Interactive UIs, teaches you about updating displays, and detecting and responding to user input actions, such as mouseovers. There are recipes for panels in visual layers, radio buttons and toggle groups, interactive text entry, directional radars, countdown timers, and custom mouse cursors.

Chapter 3, Inventory and Advanced UIs, relates to the many games that involve the player collecting items, such as keys to open doors and ammo for weapons, or choosing from a selection of items, such as from a collection of spells to cast. The recipes in this chapter offer a range of text and graphical solutions for displaying inventory status to the player, including whether they are carrying an item or not and the maximum number of items they are able to collect.

Chapter 4, Playing and Manipulating Sounds, suggests ways to use sound effects and soundtrack music to make your game more interesting. The chapter demonstrates how to manipulate sound at runtime through the use of scripts, Reverb Zones, and the Audio Mixer. It also includes recipes for real-time graphics visualizations of playing sounds, and a recipe to create a simple 140 bpm loop manager.

Chapter 5, Textures, Materials, and 3D Objects, contains recipes that will give you a better understanding of how to create, import, and modify 3D objects in Scenes. Recipes for this chapter include controlling how objects look by changing their textures and transparency, as well as creating GameObjects by creating and manipulating geometric primitives such as cubes and spheres.

Chapter 6, Creating 3D Environments with Terrains, contains recipes that will give you a better understanding of how to create and modify the large-scale geography of a Scene using the Unity terrain tools. You’ll learn how to texture and height paint terrains, add holes, trees and vegetation, and also begin to explore the powerful, dynamic, realistic water features possible in HDRP (High Definition Render Pipeline) projects.

Chapter 7, Creating 3D Geometry with ProBuilder, contains recipes that will give you a better understanding of how to create and modify 3D objects within the Unity Editor using the powerful ProBuilder toolkit. As well as the basics of working with geometric meshes, you’ll learn to extrude, texture, and vertex paint objects, gaining the skills to quickly prototype terrains and objects for complex game levels.

Chapter 8, 2D Animation and Physics, introduces some of Unity’s powerful 2D animation and physics features. In this chapter, we present recipes to help you understand the relationships between the different animation elements in Unity, exploring the movement of different parts of the body and the use of sprite-sheet image files that contain sequences of sprite frame pictures. In this chapter, core Unity Animation concepts are presented, including Animation State Machines, Transitions, and Trigger events, as well as clipping via Sprite Masks. In addition, this chapter introduces the use of Tiles and Tilemaps for 2D games.

Chapter 9, Animated Character, focuses on character animation and demonstrates how to take advantage of Unity’s Mecanim animation system. It covers a range of subjects, from basic character setup to controlling character animations with the old and new input systems.

Chapter 10, Saving and Loading Data,explores how games running on devices can benefit from persistent file-based data, and also communication with other networked applications. In this chapter, a range of recipes are presented that illustrate how to save and load data between Scenes, how to read data from text files, how to set up an online, database-driven leaderboard, and how to write Unity games that can communicate with such online systems.

Chapter 11, Controlling and Choosing Positions, presents a range of recipes for 2D and 3D user- and computer-controlled objects and characters, which can lead to games with a richer and more exciting user experience. Examples of these recipes include spawn-points, checkpoints, and physics-based approaches, such as applying forces when clicking on objects and firing projectiles into the Scene.

Chapter 12, Navigation Meshes and Agents, explores ways that Unity’s NavMeshes and NavMesh Agents offer for the automation of object and character movement and pathfinding in your games. For example, recipes include ways to make objects follow predefined sequences of waypoints, or be controlled by mouse clicks for point-and-click control.

Chapter 13, Cameras, Lighting, and Visual Effects, presents recipes covering techniques for controlling and enhancing your game’s cameras. It offers solutions to work with both single and multiple cameras, illustrates how to apply post-processing effects, such as vignettes and grainy grayscale videos. The chapter also introduces ways to work with Unity’s powerful Cinemachine components. Other recipes in this chapter introduce visual effects including emissive materials and “cookie” textures, simulating objects casting shadows between the light source and the surfaces lights shine onto.

Chapter 14, Shader Graphs and Video Players, covers two powerful visual components in Unity: Shader Graphs and the Video Player. Both make it easy to add impressive visuals to your games with little or no programming. It includes recipes on how to simulate CCTV playback and download and play an online video, as well as an introduction to applying Shader Graphs in projects. Several recipes are presented for each of these features in this chapter.

Chapter 15, Particle Systems and Other Visual Effects, offers a hands-on approach to both using and repurposing Unity’s particle systems package, and also creating your own particle system from scratch.

Chapter 16, Mobile Games and Apps, provides an overview of and introduction to mobile projects in Unity. Since AR/VR/XR projects are mobile applications, this chapter acts as a foundation for those chapters too (Chapters 17 and 18).

Chapter 17, Augmented Reality (AR), provides an overview of and introduction to AR projects in Unity. The recipes guide you through exploring the Unity AR examples, then creating and configuring your own AR projects.

Chapter 18, Virtual and Extended Reality (VR/XR), provides an overview of and introduction to VR projects in Unity. Recipes include creating and configuring projects for VR, adding content, and building apps and deploying them onto devices or publishing them as WebXR via the web.

Chapter 19, Advanced Topics: Gizmos, Automated Testing, and More, explores a range of advanced topics, including creating your own gizmos to enhance design-time work in the Scene through visual grid guides with snapping. Automated code and runtime testing is also introduced, in addition to different approaches to saving and loading game data, and a final recipe introduces the new Python for Unity package, allowing scripting in the popular Python programming language.

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Unity Cookbook - Fifth Edition
Published in: Nov 2023Publisher: PacktISBN-13: 9781805123026

Authors (3)

author image
Shaun Ferns

Shaun is a lecturer at Technological University Dublin. He is currently teaching on the BA (Hons) in Creative Digital Media where he is lead in the delivery of the Multimedia Stream. He is currently exploring serious games for construction-related training as well as the opportunities transmedia provides in improving user experience and engagement in cultural archive artifacts. His educational research is currently driven by his interest in self-determined learning (heutagogy), rhizomatic learning theory, micro-credentialing /digital badging, and curriculum development.
Read more about Shaun Ferns

author image
Sinéad Murphy

Sinead Murphy is currently Data Analytics Manager for the Irish NGO Trocaire. She has over 25 years of computing experience, including freelance IT training and database consulting, university lecturing in mathematics, IT skills and programming at TU Dublin (Ireland) and Middlesex University (London). She is a published academic, with undergraduate and postgraduate degrees in mathematics, computing and data science. She is passionate about the use of IT for understanding and visualising data, and using that understanding to make meaningful differences in the world. She is currently exploring the use of Python and Unity for data analytics and interactive visualisations.
Read more about Sinéad Murphy