Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

unity json save array

public class MyArray {
	public T[] array;
}

var class = new MyArray();
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<MyArray>(inputString);
Source by forum.unity.com #
 
PREVIOUS NEXT
Tagged: #unity #json #save #array
ADD COMMENT
Topic
Name
4+5 =