- Home /
WebGL and I/O
I managed to get my project running on WebGL. Now I run into expected i/o issues.
This is the code loading the config.xml file:
public void loadSettings(string pathToSettings)
{
if (pathToSettings.Length > 0)
{
// Windows, Linux, Mac OSX Standalone Plattform
FileInfo fi = new FileInfo(pathToSettings);
if (fi.Exists)
{
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(pathToSettings);
this.loadSettings(xmlDoc);
}
else
{
throw new FileNotFoundException(pathToSettings);
}
}
else
{
throw new FileNotFoundException();
}
}
and i get the following message:
FileNotFoundException:
file:///D:/Unity%20Projects/Chatbot_WebGL_5.2.0f3/Chatbot_WebGL/Chatbot/Program #/config/Settings.xml
>AIMLbot.Utils.SettingsDictionary.loadSettings (System.String pathToSettings)
AIMLbot.Bot.loadSettings (System.String pathToSettings)
AIMLTestChat.Start ()
i tried to call this function with another string(other, normal formating of file path) and get this error although the path is definitely correct:
FileNotFoundException: D:/Unity Projects/Chatbot_WebGL_5.2.0f3/Chatbot_WebGL/Chatbot/Program #/config/Settings.xml
May it be, that FileInfo or XmlDocument aren't supported?
Best,
Andre
Ok, its this line throwing the filenotfoundexception:
FileInfo fi = new FileInfo(pathToSettings);
Is it supported?
Answer by SkandYxyz · Feb 16, 2016 at 11:00 PM
I found a link describing the i/o restrictions of the WebGL plattform, maybe it'll help: http://stackoverflow.com/questions/34116366/editorutility-openfilepanel-for-unity-webgl-runtime
Okay, their solution is to use the www class that I also used for the webplayer plattform. It should work this way probably.
Your answer
Follow this Question
Related Questions
Unexpected output on IOS Device 1 Answer
WebGL Input - KeypadEnter registering as Return 0 Answers
Help With Unity WebGL 0 Answers
Problems with Input.acceleration in Unity 4.1 1 Answer
WebGL Build Error: IL2CPP error 0 Answers