saving data

ok so idk if this is possible or not, but say I have a class of data set up.

public class Test(){

public string test1;
public int test2;

public Test(){
test1 = "";
test2 = 0;
}

public Test(string thestring, int theint){
test1 = thestring;
test2 = theint;
}

}

and now I have it assigned to a variable.

public Test newtest;

void Start(){
newtest = new Test("Hi",10);
}

how would I go about saving my variable “newtest”? is there a way to save the entire Test() object I’ve created into an xml file or playerprefs? if so, how?

or would I have to save each individual value of test and on loading the game go back through it and re-assign the variables.

^this.

In this case, XML parsing would be much better than playerprefs or a simple text file, so you can keep your object hierarchy.

Check the first set of code on the post that I just made.

http://forum.unity3d.com/threads/109154-XML-On-Web-Player