Hello,
It’s my firs post on the forum. I would like to know why Unity freezes when I run the following code. I wanted to make an array with 12 objects, and each object will have 6 properties (a 2 dimension array). After this, I want to read from a file all the properties.
import System.IO;
try{
// Create an instance of StreamReader to read from a file.
sr = new StreamReader("TestFile_qlgame.txt");
// Read and display lines from the file until the end of the file is reached.
line = sr.ReadLine();
while (line != null) {
var myObj=new Array(); // the objects
for(i=0;i<=11;i++){ // 12 objects
myObj[i]=new Array(); // properties of objects
for(j=0;j<=5;j++){ // nr of properties for each object
myObj[i][j]=sr.ReadLine();
Debug.Log(myObj[i][j]); // DEBUG
}
}
}
sr.Close();
}
Thanks in advance.