//public DialogueTodorokiEng todoroki; void Awake() { DialogueTodorokiEng todoroki = new DialogueTodorokiEng(); SaveDialogue(todoroki); Debug.Log(todoroki); // string todorokiEnJson = JsonUtility.ToJson(todorokiEn); }
public void SaveDialogue(DialogueTodorokiEng dict) { //Send out a signal to SaveSystem that passes through this object and fileName. string path = System.IO.Path.Combine(Application.persistentDataPath, dict + ".json"); // string jsontest = JsonUtility.ToJson(hello); string json = JsonConvert.SerializeObject(dict, Formatting.Indented); File.WriteAllText(path, json); Debug.Log(json); //Only prints the string "Hello", not the dict. // using (FileStream stream = new FileStream(path, FileMode.Create)) // { // // } }