Hi Joel,
Thanks for your quick reply.
Here my new test script:
Code: Select all
using UnityEngine;
public class Test : MonoBehaviour
{
public void Testing()
{
string fromJson;
ES3.Save<int>("test_1", 5, "saveFile.txt");
ES3.Save<float>("test_2", 5.4f, "saveFile.txt");
ES3.Save<string>("test_3", "Joel", "saveFile.txt");
fromJson = ES3.LoadRawString("saveFile.txt");
//Sending fromJson to server and getting again from server
Debug.Log(fromJson);
ES3.SaveRaw(fromJson, "ourFile.txt", new ES3Settings());
Debug.Log("test_1: " + ES3.Load<int>("test_1", "ourFile.txt"));
Debug.Log("test_2: " + ES3.Load<float>("test_2", "ourFile.txt"));
Debug.Log("test_3: " + ES3.Load<string>("test_3", "ourFile.txt"));
}
}
I'm getting this log:
{\"test_3\":{\"__type\":\"System.String,mscorlib\",\"value\":\"Joel\"},\"test_2\":{\"__type\":\"System.Single,mscorlib\",\"value\":5.4},\"test_1\":{\"__type\":\"System.Int32,mscorlib\",\"value\":5}}
But when I use SaveRaw and try to get from new .txt file I'm getting this error message:
FormatException: Expected ',' separating properties or '"' before property name, found '\'.
ES3Internal.ES3JSONReader.ReadPropertyName () (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3JSONReader.cs:62)
ES3Internal.ES3JSONReader.Goto (System.String key) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3JSONReader.cs:197)
ES3Reader.Read[Int32] (System.String key) (at Assets/Plugins/Easy Save 3/Scripts/Readers/ES3Reader.cs:157)
ES3.Load[Int32] (System.String key, .ES3Settings settings) (at Assets/Plugins/Easy Save 3/Scripts/ES3.cs:256)
ES3.Load[Int32] (System.String key, System.String filePath) (at Assets/Plugins/Easy Save 3/Scripts/ES3.cs:235)
EDIT:
Here is the save files:
Before Load/SaveRaw, saveFile.txt:
{"test_3":{"__type":"System.String,mscorlib","value":"Joel"},"test_2":{"__type":"System.Single,mscorlib","value":5.4},"test_1":{"__type":"System.Int32,mscorlib","value":5}}
After LoadRaw, ourFile.txt:
{\"test_3\":{\"__type\":\"System.String,mscorlib\",\"value\":\"Joel\"},\"test_2\":{\"__type\":\"System.Single,mscorlib\",\"value\":5.4},\"test_1\":{\"__type\":\"System.Int32,mscorlib\",\"value\":5}}
EDIT AGAIN:
I found the reason. It's because of our server.

Thanks again.
Best regards,