This file is the instructions on setting up a Unity Environment to be able ot edit and change the project.
Using LTS Release 2021.1.19f1
- Including build support for Linux, Mac, and Windows.
Install this version of Unity from Unity Hub
- Here are instructions how to install and setup Unity Hub instructions link
- If this link for Unity Hub does not work try using the downloads provided on this forum page This will also have a download for Linux.
- This should work for linux, if not here is a supplemental article on setting up unity hub in linux. article link
Before you can use Unity hub, you need to setup a license
- If you are a student or using this for a personal project, you can get a personal license.
- If you do not qualify for a personal license use your company license.
- For more information about licenses, please check Unity's License Page
Install the proper version of Unity from UnityHub using this unity hub link unityhub://2021.1.19f1/d0d1bb862f9d
- Note, UnityHub must be registered on your system for it to open the Unity Hub App.
- To do this in linux, just launch the downloaded
UnityHub.AppImage
file.
In order to fully load and edit the project, you must have Blender version 2.8 or more recent. Download for Blender can be found here. Blender is an open source piece of software used for 3d modeling, animation, and texturing (as well as many other features).
Now that the proper version of unity has been installed, open the project with UnityHub. In order to do this, you must first clone the repo:
# This can be anywhere you want to store the project
$ cd ~/projects
# Download the git repo
$ git clone git@github.com:nicholas-maltbie/FallingParkour.git
# If you do not have ssh key setup, you can download via https
$ git clone https://github.com/nicholas-maltbie/FallingParkour.git
Version Control: This project uses a combination of git, git-lfs, and github.
Ensure that you have git installed. If not here is a guide to install git
git --version
Ensure that you also have git lfs installed. It should be setup to auto-track certain types of files as determined in the .gitattributes
file. If the command to install git-lfs git lfs install
is giving you trouble, try looking into the installation guide
# Run this inside the repository after cloning it
# May need to run this on linux
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
sudo apt-get install git-lfs
Once git-lfs is installed, you can setup the githooks for the project from the .githooks
directory. In order to do this, use the following command to reconfigure the core.hooksPath
for your repository
git config --local core.hooksPath .githooks
This will setup the tools. Ensure you also complete step 5.1 to properly install dotnet. The tool dotnet format
will be automatically installed and used to check and verify the formatting of your C# files when working with the project using settings form the .editorconfig
file in the repository. If you want to install dotnet format before making a commit, use the command dotnet restore
from the base of the repository and it will install the tool.
After you have downloaded the git repo, launch unity hub and navigate to the Projects
section on the
menu on the left half of the screen.
From this file menu, navigate to the folder where the
project has been downloaded. For example
~/projects/FallingParkour
. Then hit the Open
button in the file selector.
After the environment has a chance to load, the project should be listed in the projects area as shown in the image below.
Languages: C#
The compilers for these are included in Unity but having the .NET Core SDK
is required for the IDE. Instructions to install .NET Core SDK
: Installation Instructions. There should be a .exe
for windows, a set of commands for linux or mac.
- Note If you are installing for linux, ensure that you have the mono libraries installed. Mono Libraries: https://www.mono-project.com/download/stable
- Additional Note You may need to reboot the computer after installing the
.NET Core SDK
.
Also make sure to be using .NET 4.x compatibility in Unity. This will allow for full use of libraries and other features. For more information on how to do this, follow Microsoft's guide to switch Unity to .NET 4.x.
To enable the .NET 4.x scripting runtime, take the following steps:
- Open PlayerSettings in the Unity Inspector by selecting
Edit > Project Settings > Player > Other Settings
. - Under the Configuration heading, click the Scripting Runtime Version dropdown and select .NET 4.x Equivalent. You will be prompted to restart Unity.
From Microsoft's article (Unity to .NET 4.x)
If you wish to add new .NET libraries to the project, See Microsoft's page on Using .NET 4.x in Unity
and the sub section of "taking advance of .NET compatibility".
You simply have to add the .dll
file from the
project package archive. Instructions on how to get this and
implement these changes are in the article linked above.
The IDE we are using is VSCode.
- Make sure that you have the
.NET Core SDK
installed. Installation Instructions. (See earlier section Languages for more information)
To add VSCode as Unity's default editor, select it under: Edit > Preferences > External Tools > External Script Editor
.
Unity Article on VSCode and Unity for reference Article.
In the Unity Environment use the following sub-menus
Edit > Preferences > External Tools > External Script Editor
- Edit (Top left of screen)
- Preferences (Lower section of the edit menu)
- External Tools (Lower section of sub menus for Preferences)
- Select Visual Studio Code from the External Script Editor
Using the following extensions for VSCode. For information about installing extensions, use this article
- C# by Microsoft.
- Debugger for Unity by Unity Technologies.
- Unity Tools by Tobiah.
- Unity Code Snippets by kleber-swf.
- Unity Snippets by YclepticStudios.
- C# XML Documentation Comments by Keisuke Kato.
- Code Spell Checker by Street Side Software (because Nick can't spell and properly spelled comments are great).
As far as coding style, please try to stay consistent with C# Coding Guidelines from Unity's reference guide.
There is a tool in the repo installed as part of the githooks called dotnet format
that will verify the style of your code with every commit and whenever you make a pull request to the github repository.
- If your unity fails to open the project during import, it may be due to having the packages locked. To fix this try closing Unity and the IDE (most likely VS Code or Visual Studio) and re-open the project. After the project loads you can open the project and IDE without issue.
- If your unity fails to run on the scenes with an error about assets, models, meshes, or prefabs, it may be due to not having the required libraries installed. Make sure you have Blender installed (v2.8 or greater). Make sure that you restart your machine after installing Blender.