Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

unity save list to json

public class MyList {
	public List<T> list;
}

var class = new MyList();
var outputString = JsonUtility.ToJson(class);
File.WriteAllText("C:MyFile.json", outputString);

//In reverse, you can deserialize anything doing this:
var inputString = File.ReadAllText("C:MyFile.json");
var class = JsonUtility.FromJson<MyList>(inputString);
Source by forum.unity.com #
 
PREVIOUS NEXT
Tagged: #unity #save #list #json
ADD COMMENT
Topic
Name
8+4 =