-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Unity Cookbook
By :

To complete the recipes in this book, there are some things that you will need.
For all chapters, you will need Unity 2023.1 or later, plus one of the following computer systems:
For each chapter, there is a folder in the book’s GitHub repository that contains the asset files you will need; you can find these at https://github.com/PacktPublishing/Unity-2023-Cookbook-Fifth-Edition.
For recipes in some chapters, additional hardware/software will be helpful:
To edit and create audio files yourself, you can download and install the free Audacity application for your computer system (Windows/Mac/Linux). You can find it at https://www.audacityteam.org/download/.
To work with 3D objects in the Blender editor, you can download it for free at www.blender.org.
If you wish to create your own image files, you will also need an image editor, such as Adobe Photoshop, which can be found at www.adobe.com, or GIMP, which is a free alternative and can be found at www.gimp.org/.
To get the most from this chapter’s recipes, you will need an AR device. For this, you can use a dedicated device such as an AR headset, or you can use smartphone apps to begin experiencing AR.
You will need a device to view VR apps. For this, you can use a dedicated device, such as a VR headset like the Meta Quest 1/2/3, Samsung Gear VR, or Apple Vision Pro. If you wish to use a smartphone for VR projects, there are many low-cost devices to choose from, such as Google Cardboard: https://developers.google.com/cardboard.
You’ll find the chapter figures, recipe assets, and completed Unity projects for each chapter at https://github.com/PacktPublishing/Unity-2023-Cookbook-Fifth-Edition.
You can either download these files as ZIP archives or use free Git software to download (clone) these files. These GitHub repositories will be updated with any improvements.
We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!
We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: https://packt.link/gbp/9781805123026.
There are a number of text conventions used throughout this book.
CodeInText
: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: “The playerInventoryDisplay
variable is a reference to an instance object of the PlayerInventoryDisplay
class.”
A block of code is set as follows:
public class PlayerInventoryDisplay : MonoBehaviour {
public Text starText;
public void OnChangeStarTotal(int numStars) {
string starMessage = "total stars = " + numStars;
starText.text = starMessage;
}
}
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold, like this:
public class PlayerInventoryDisplay : MonoBehaviour {
public Text starText;
public void OnChangeStarTotal(int numStars) {
string starMessage = "total stars = " + numStars;
starText.text = starMessage;
}
}
Bold: Indicates a new term, an important word, or words that you see onscreen. For example, words in menus or dialog boxes appear in the text like this: “In the Inspector panel, set the font of Text-carrying-star
to Xolonium-Bold, and set its color to yellow.”
Warnings or important notes appear like this.
Tips and tricks appear like this.