I have spend the last couple of hours trying to load a simple xml file into my project. My project is supposed to run in the webplayer and this is where all my problems start - everything works just fine from the editor, but as soon as I build my webplayer nothing works. Just for fun and because I ran out of options I tried to make a very simple test and try it out in unity 2.6 and now everything is fine ?? In the Unity 2.6 version I can see all of my xml file in my test gui, but in the exact same project, just build from unity 3.3 I get the Error message - see simple code below
using UnityEngine;
using System.Collections;
public class NewBehaviourScript : MonoBehaviour {
private string xmlData;
// Use this for initialization
IEnumerator Start ()
{
string path = "http://www.aneks.dk/pxml/Mysterium.xml";
WWW xmlDownload = new WWW(path);
yield return xmlDownload;
Debug.Log("DownLoad done");
if(xmlDownload.error == null)
{
Debug.Log("DownLoad Succes");
xmlData = xmlDownload.data;
}
else
{
Debug.Log("DownLoad Error");
xmlData = "ERROR";
}
xmlDownload.Dispose();
xmlDownload = null;
}
void OnGUI()
{
GUI.Label(new Rect(10f, 10f, 300f, 600f), xmlData);
}
}
Did something regarding reading xml files change in unity 3.3 ?
I hope somebody can help me, cause I run out of things to try.
Best
Claus