Saving with JSON

I’m wondering if anyone knows how to serialize into a JSON file? Basically I want to be able to save a .json file in script and then load it later. I just need some help guiding my way to learning to use the saving process of JSON in unity.

Depending on which plattform you need to support there are different solutions as there is no builtin one. If you don’t need iOS support basically any library you can find with google is supported. Two I have used are Json.net and JsonFx. If you want full support for all unity plattforms there is at least a Json.net package in the assetstore that supports all plattforms and a lot of others too.
Last way would be to write a json reader/writer yourself (As json itself isn’t that hard of a format). But that depends on your skill level with such things.

//#define USE_SharpZipLib#if !UNITY_WEBPLAYER#define USE_FileIO#endif/ - Pastebin.com SimpleJSON script
using UnityEngine;using System.Collections.Generic;using SimpleJSON;name - Pastebin.com JSONLoader script

These are what two scripts I use for json loading. They were provided to me by a friend in the project I’m on. And what I’m working with is a Standalone build.

You can parse it and store it in PlayerPrefs as a string. No need to create a seperate file then.

I’d still like to know how to save it to a file :stuck_out_tongue:
if it isn’t too troubling for someone to explain.

http://unity3d.com/learn/tutorials/modules/beginner/live-training-archive/persistence-data-saving-loading

I was having trouble with binarywriters and readers so that’s why I resorted to JSON