OK so i need to read a string, divide it to an array, the string will contain urls that i need to download and put in another array, and it will use eval() to execute them. so here’s my code:
var mods:String;
var modlist:String[];
var temp1:int = 0;
var www:WWW[];
function Start() {
mods = PlayerPrefs.GetString("mods");
modlist = mods.Split(","[0]);
while (temp1 < modlist.length) {
www[temp1] = new WWW (modlist[temp1]);
yield www[temp1];
temp1++;
}
temp1 = 0;
var modtext:String[];
while(temp1 < modlist.length) {
modtext[temp1] = www[temp1].text;
eval(modtext[temp1]);
}
}
then it says:
NullReferenceException: Object reference not set to an instance of an object
(wrapper stelemref) object:stelemref (object,intptr,object)
mods+$Start$24+$.MoveNext () (at Assets/Scripts/mods.js:34)