Dear co-uniters,
I’d like to read configuration data from a text file on the server. I’m using this simple script:
string conf_file = Application.dataPath + "/config.txt";
WWW www = new WWW(conf_file);
float time_start = Time.realtimeSinceStartup;
while (!www.isDone && Time.realtimeSinceStartup < time_start + 5.0f) { };
if (!www.isDone)
return "Could not load '" + conf_file + "'";
else
return www.text;
I’ve done these things from a standalone app without problems, but built as webplayer I keep getting the ‘could not load’ error, whether I run it locally or on a server. The text file is in the same dir as the .unity3d file and is accessible (at least I can open it in the browser).
Does anyone know what I’m doing wrong?