I need to save over 500kb of text. Currently it takes 1-2 minutes, what is the best way to read and write text like this.
this is the format that is repeated thousands of times
Name(Position Data)
So what i am doing is looping all gameobjects with tag and then getting there vector3 and the name
when i load i am looping the name(Position Data) and instantiate that block with a variable and setting its name
here is my code for getting the string to write into my file
function GetParams(){
var Out : String = "";
for (var Go : GameObject in GameObject.FindGameObjectsWithTag("Item")){
if (Go.GetComponent(ItemController)) {
//if (CheckIf(Go)) {
Out += (Go.name + "[" + Go.transform.position.x + "/" + Go.transform.position.y + "/" + Go.transform.position.z + "/" + BoolToInt(Go.GetComponent(ItemController).Foraged) + "/" + Mathf.FloorToInt(Go.transform.eulerAngles.x) + "/" + Mathf.FloorToInt(Go.transform.eulerAngles.y) + "/" + Mathf.FloorToInt(Go.transform.eulerAngles.z) + "],");
//Destroy(Go);
//}
}
}
return Out;
}