How to install NewtonSoft Json in unity or Visual studio code?

Hello.
I’m transitioning to Json saving trying following the Brian’s tutorial but I must admit i’m a little bit confuse according NewtonSoft Json.
I assume I haven’t any Json install in my unity version:

or Json:

And I don’t understand at all how to install it.
When I type “install newtonSoft Json” I find this page:

https://docs.unity3d.com/Packages/com.unity.nuget.newtonsoft-json@3.0/manual/index.html

if I click on JSON Net Main page i arrive here:

https://www.newtonsoft.com/json

And after?
Lol I’m totally lost with this kind of process :slight_smile:
What is the way to install easily this code?
Scuse for my “programing level” but I must say for me it’s absolutly not obvious lol.

In the Asset Store they say it’s deprecated.

https://assetstore.unity.com/packages/tools/input-management/json-net-for-unity-11347

I use the 2022.3.14f1, the latest LTS one.

Thanks for your feedback and sorry for my level.
Have a good day.

François

The way to install Newtonsoft has changed a bit… for while in Unity 2022 2 and below, it was actually installed automagically because Unity itself was using the library, but they’ve migrated away from that for the most part.

Check out this page for the install instructions to install by name (towards the bottom of the page). This is the beginning of a draft version of an overhaul and under the hood explanation of how the Saving System works, but the important bit you’re looking for is getting it set up in the first place.

Thank you.
I’ll look at that this afternoon.
Have a nice day.
François

Yeaahhh !!!
It is so much easy and clear when it’s you who explain how to install NewtonSoft Json :slight_smile:

Thnak you Brian, I keep on the saving update :slight_smile:

François

Edit: I assume to keep the 3.2.1 version in the manifest, not the 2.0.0.

Edit 2:
I had the missing method (for me) in the JsonSavingSystem.cs under the public IEnumerable ListSaves() method

        public bool SaveFileExist(string saveFile)//Methode ajoutée car manquante dans le tuto Json
        {
            string path = GetPathFromSaveFile(saveFile);
            return File.Exists(path);
        }

and actually it lloks save the file in Json :slight_smile:

image

Actually all the replacement with Json according XP healtth, equipment, inventory, mover, ActionStore, ItemDropper and PickupSpawner works fine :slight_smile:
Just a remark, for the modification in the PickupSpawner.cs, I believe you don’t precise to add the JSonSaveableEntity.cs script.
Or maybe I missed it during the lecture ?

image

Thanks a lot for this really clear Tutorial.
I’ll keep on this night :slight_smile:
François

Ok, I followed the Brian’s tutorial according transform Serialized Saves in Json Saves.
Everything goes well.
I keep on until Encryptation and hadn’t any trouble :slight_smile:
Thanks you Brian.
François

Yes, you always want the latest version available to avoid conflicts with anything else Unity might be doing. Basically, at this point, if you are using Newtonsoft, Unity wants you using the latest version.

It’s possible I didn’t. You figured it out, though. Basically, if it would have gotten a SaveableEntity, it will now get a JsonSaveableEntity.