To get the most out of this book
If you don’t yet have Unity installed on your PC or laptop, don’t worry – we will guide you through this process in Chapter 2.
Software/hardware covered in the book |
Operating system requirements |
Unity version 2021.3.4 or later |
Windows, macOS, or Linux |
As you venture into creating immersive virtual, augmented, and mixed reality experiences, it’s crucial to set the foundation right. This starts by cloning the project repository using Git LFS. Even if you plan to build all projects from the ground up, it’s highly recommended to clone the entire repository. There will undoubtedly be sections where cross-referencing your progress with the actual solution will prove beneficial.
Attention
Do not simply download the repository in a ZIP format. Doing so will most likely result in errors upon opening. The correct approach is to clone it using Git LFS.
When working on virtual, augmented, and mixed reality projects in Unity, it’s common to handle large files – think 3D models, textures, audio clips, and more. Simply downloading a project might seem like a straightforward approach, but you may run into issues. The reason is rooted in how GitHub (and many other platforms) handle large files.
Let’s illustrate this with a simple analogy. Imagine you have a vast library of books. Instead of storing all these books at your home, which would take up enormous space, you get a reference card for each book. Whenever you want to read a particular book, you present the card at the library, and they provide the book for you.
Git LFS, which stands for Git Large File Storage, operates on a similar principle. Instead of saving bulky files directly within the repository, Git LFS maintains a tiny reference or “pointer.” The actual hefty files are stored elsewhere. Consequently, when you directly download a project without employing LFS, you only obtain these pointers, not the genuine files. To secure the entire content, you must clone the project with Git LFS.
The installation process for Git LFS and cloning our repository is very straightforward. Here’s a step-by-step guide:
- Install Git: If you have Windows, download Git from the Git for Windows website (https://gitforwindows.org/), and follow the installation instructions. For macOS, you can either download Git from the official website (https://git-scm.com/download/mac) or simply use
brew install git
in your Terminal if you have Homebrew. For Linux, use your package manager, such assudo apt-get install git
for Debian-based distributions. - Setting up Git: Open your Terminal or Command Prompt. Configure your username with
git config --global user.name "Your Name"
. Configure your email withgit config --global
user.email "[email protected]"
. - Install Git LFS: Visit the official Git LFS website (https://git-lfs.com/) and follow their installation instructions.
- Initialize Git LFS: In your Terminal or Command Prompt, type
git lfs install
. This sets up Git LFS for your user account. - Sign up for GitHub: If you haven’t already, create a free account on GitHub (https://git-lfs.com/).
- Clone the Repository: Navigate to the directory where you want to clone the project. Open your Terminal. Use the
git clone
https://github.com/PacktPublishing/XR-Development-with-Unity.git
command.
That’s it! You’re now ready to work with the Git repository and Git LFS to manage large files.
If you are using the digital version of this book, we advise you to type the code yourself or access the code from the book’s GitHub repository (a link is available in the next section). Doing so will help you avoid any potential errors related to the copying and pasting of code.