Skip to content
This repository has been archived by the owner on Oct 6, 2023. It is now read-only.

Installation via Git in UPM

Kalle Jillheden edited this page Feb 27, 2021 · 3 revisions

Unity Package Manager, or UPM for short, is Unity's new solution for managing packages so they don't need to be included inside the /Assets folder.

Have a look at the Unity Package Manager docs for more info.

This guide shows how to install Newtonsoft.Json-for-Unity using Git via UPM.

Prerequisites

  1. Requires Unity Editor 2018.1 or above, as UPM was first shipped with 2018.1.

  2. Git installed on your machine. See download instructions here: https://git-scm.com/downloads

Installing the package

  1. Find your version in the list of tags: https://github.com/jilleJr/Newtonsoft.Json-for-Unity/tags

  2. Open <project>/Packages/manifest.json, add the package in the list of dependencies, replacing the tag after the hash sign (#) with your version of choice.

À la:

{
  "dependencies": {
    "jillejr.newtonsoft.json-for-unity": "https://github.com/jilleJr/Newtonsoft.Json-for-Unity.git#12.0.302",

    /* ... rest of Unity packages ... */
  }
}

Done!

Updating the package

  1. Find which version you want to upgrade to in the list of tags: https://github.com/jilleJr/Newtonsoft.Json-for-Unity/tags

  2. Open <project>/Packages/manifest.json, change the version of the package in the list of dependencies by changing the value after the hash sign. For example, from #12.0.101 to #12.0.301.

  3. Then also remove the version lock for the package to force UPM to fetch the new version of the package.

Sample changeset:

@@ Packages/manifest.json @@
{
  "dependencies": {
-    "jillejr.newtonsoft.json-for-unity": "https://github.com/jilleJr/Newtonsoft.Json-for-Unity.git#12.0.101",
+    "jillejr.newtonsoft.json-for-unity": "https://github.com/jilleJr/Newtonsoft.Json-for-Unity.git#12.0.301",

    /* ... rest of Unity packages ... */
  },
  "lock": {
-    "jillejr.newtonsoft.json-for-unity": {
-      "hash": "9b9871e395be2f53e53f830af9ab586ee6e1ee3d",
-      "revision": "12.0.101"
-    }
  }
}
Clone this wiki locally