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

Install Converters via UPM

Kalle Jillheden edited this page Mar 27, 2021 · 5 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 the jilleJr/Newtonsoft.Json-for-Unity.Converters project via UPM.

The converters project contains lots of converters to be able to successfully read and write JSON data that uses Unity types, such as Vector3, Quaternion, Bounds, LayerMask, et.al.

Prerequisites

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

  2. You already have installed Newtonsoft.Json installed to your Unity project.

    You may visit the any of the "Getting started > Install Newtonsoft.Json-for-Unity" wiki pages to install that beforehand.

Installing the package

If you already have the jilleJr/Newtonsoft.Json-for-Unity scoped registry configured

⚠ This guide does not apply if you have installed Newtonsoft.Json via some other source, such as the GlitchEnzo/NuGetForUnity utility.

This only applies if you have installed the jillejr.newtonsoft.json-for-unity UPM package.

  1. Open the Package Manager UI Window > Package Manager

    preview of where window button is

  2. Make sure you're viewing "All packages" and not just "In Project"

  3. Search for json

  4. Click the "Json .NET Converters of Unity types" package

    showing search results

  5. Click "Install"

    install button down at bottom right

  6. Done!

If you don't have the jilleJr/Newtonsoft.Json-for-Unity scoped registry configured

Open <project>/Packages/manifest.json, add scope for jillejr, then add the package in the list of dependencies.

À la:

{
  "scopedRegistries": [
    {
      "name": "Packages from jillejr",
      "url": "https://npm.cloudsmith.io/jillejr/newtonsoft-json-for-unity/",
      "scopes": ["jillejr"]
    }
  ],
  "dependencies": {
    "jillejr.newtonsoft.json-for-unity": "12.0.101",
    "jillejr.newtonsoft.json-for-unity.converters": "1.0.0",

    //...
  }
}

// ... signals the rest of the packages you have in the manifest.json, such as all the "com.unity.*" dependencies

Done!

Updating the package

Updating via the UI

Open the Package Manager UI Window > Package Manager

where to open package manager window

Followed by pressing the "Update to x.x.x" button down at the lower right while having the jillejr.newtonsoft.json-for-unity.converters package selected.

outdated package in package list

update button

Clone this wiki locally