In my standalone app, I get the names of files in a folder that is located in the same place as the executable using Directory.GetFiles(). How can the same thing be achieved in a WebGL build if I put the folder in the same place as the index.html?
I’ve tried using the WWW class, but I think it can only retrieve information about individual files, not folders. I need to get information about the folder, since I don’t know what the names of the files or quantity of files will be. Basically, I want to be able to iterate through the contents of the folder, using the filenames and later loading the files. WebGL is pretty challenging to debug, but the WWW object seems to be null when given the url of a folder since in Debug.Log all of the properties of the object print out as blank:
WWW www = new WWW(Application.dataPath + "/myDir");
yield return www;
I’ve also tried using mapPath() the way it is used in an answer I found to a similar question:
Answer regarding mapPath
It is supposed to map the virtual path to a physical directory that can be passed in to Directory.GetFiles(), but that is throwing a null reference error.