1- # JSON Serializer Package
2- <i >A JSON serializer package for Unity which supports reading from and writing to JSON files. </i >
1+ # JSON Serializer Plugin
2+ <i >A JSON serializer plugin for Unity which supports reading from and writing to JSON files. </i >
33
4- Check out [ releases] ( https://github.com/Persomatey/JSONSerializePackage /releases ) to download the unity package.
4+ Check out [ releases] ( https://github.com/Persomatey/JSONSerializePlugin /releases ) to download the unity package.
55
66<img src =" https://raw.githubusercontent.com/Persomatey/JSONSerializerPlugin/main/Logo/JSONSerializerPluginLogo.png " width =" 318 " />
77
88## Tutorial
9+ <details >
10+ <summary >Tutorial</summary >
911
1012### Setup
1113Since everything in this plugin is wrapped in a JSON namespace, you'll need to add it at the top of your script.
@@ -18,7 +20,7 @@ Because .json files are read as TextAssets in Unity, you'll need a reference to
1820[SerializeField] TextAsset file;
1921public TextAsset file;
2022```
21-
23+ ---
2224### Creating a new JSON object from a file
2325Call the constructor, using the TextAsset you want read in the parameters.
2426```
@@ -28,7 +30,7 @@ There is also a constructor for if you don't have a parameter.
2830```
2931JSON myJSON = new JSON();
3032```
31-
33+ ---
3234### Serializing JSON object to a file
3335You can serialize the JSON object to the provided TextAsset file.
3436```
@@ -38,7 +40,7 @@ If no parameter was provided when object was created, you'll need to include the
3840```
3941writeJSON.WriteToFile(file);
4042```
41-
43+ ---
4244### Reading and writing JSON variables
4345To read a specific variable (` GetBool ` , ` GetInt ` , ` GetFloat ` , ` GetString ` ):
4446```
@@ -52,6 +54,8 @@ To add a variable to the JSON (`AddBool`, `AddInt`, `AddFloat`, `AddString`):
5254```
5355myJSON.AddFloat("myFloat", 24.68);
5456```
57+ ---
58+ </details >
5559
5660## Details
5761
0 commit comments