Unity setup

Assets such as icons or 3D models can be created using the Unity editor. We currently use Unity 6000.0.66f1 and it is recommended to use the same version to avoid incompatibilities.

One-time Unity setup needed for MaFi tools to function properly.

  1. Download and install Unity 6000.0.66f1 from the Unity download archive.
  2. Locate the test scene in src/ExampleMod.Unity. Do not open it yet.
  3. Create a directory link called UnityRootSymlink in src\ExampleMod.Unity\Library that points to the Unity version installation folder. This can be done by invoking mklink /D <target> <source> command in console window with admin privileges. For example: mklink /D "C:\CoiExampleMod\src\ExampleMod.Unity\Library\UnityRootSymlink" "C:\Program Files\Unity\Hub\Editor\6000.0.66f1". When you navigate to the UnityRootSymlink you should see a single Editor directory in it.
  4. Create hard-links for necessary DLLs from your Steam installation by running the src/ExampleMod.Unity/Assets/DLLs/create_dll_hardlinks.bat batch file. You will need to run it under admin privileges (right-click, Run as Administrator).
    • It is a good practice to look at any code you are running under admin privileges, so feel free to inspect the batch file first.
    • Alternatively, you could also copy the DLLs in question to this directory but hard link is better since any update to the original files will propagate.
  5. Open the test scene from src/ExampleMod.Unity/Assets/ExampleModScene.unity in the Unity Editor. This can be done via Unity Hub by selecting Open project from disk in the Projects tab. Make sure you select the right Unity version if you have multiple installed.
  6. Verify that you can see MaFi in the top menu on the Unity editor. If not, linked DLLs were not properly loaded and you will not be able to create assets.
  7. Open the ExampleModScene by double-clicking on it in the Project pane (it's under Assets directory).
  8. (optional) We also recommend changing the following settings in the Unity editor (Edit -> Preferences).
    • External tools -> External script editor -> Open by file extension. This will stop regenerating project files and placing absolute paths instead of relative.
    • General -> Disable Editor Analytics (if you can and want).