Unity

For this class we are freezing on Unity verison 2023.2.5f1.

  1. Download the Unity Hub here. Do not install the newest editor when it prompts.
  2. Activate the personal educational license. Create a Unity account if necessary.
  3. Install editor, choose Archived Versions, and install 2023.2.5f1 from the link.

You can have multiple editors installed, but for this class make sure you always use 2023.2.5f1.

The archive link goes here: https://unity.com/releases/editor/archive

VS Code

You can use any editor you like, but VS Code is the supported choice. If you already have full Visual Studio installed, you can probably use that instead if you want.

  1. Install VS Code
  2. Follow the instructions here to set it up for Unity. Roughly:
    1. Install the .NET SDK
    2. Install the C# extension in VS Code
    3. Install the Build Tools for Visual Studio 2022 (if on windows)
    4. Install targeting packs for code completion
    5. Create a Unity project and set the external editor to VS Code
      ("open by extension" isn't good enough for code completion, even if VS Code opens)
    6. In the project, add the Visual Studio Code Editor package if it is not already in Packages
  3. For existing projects, you may need to click "Regenerate project files" where you set the external editor

git

We will be using git source control for all assignments and projects. All examples will be done using the command-line interface (CLI).

You can also use a GUI if you like, but you need to be able to use the CLI first.

Basic Usage (in-class video)

You must log into blackboard for these videos to show


Unity .gitignore

Here is a Unity-specific .gitignore file. Rename it from Unity.gitignore to just .gitignore and ALWAYS put this in the root of any new project you create. (Not the repo root, the root of the Unity project folder).

Initial CLI Configuration

  • store your username and email
  • on mac or linux, cache your password so you don't have to re-enter constantly (can do --global here as well so it is not repo-specific). don't do this on windows as it is already set to use the default credential manager and you don't want to change that.

CLI Quick Reference

  git clone <repo URL>             // to create a local copy
  git status                          // to see what has changed (do this before and after all the other commands!)
  git add .                           // to stage all changes you've made
  git commit -m "a useful comment"    // to store your staged changes as a changeset
  git push                            //to upload all your changesets to GitHub

For simple individual use, you will pretty much always do add then commit then push all together.