- Home /
WWW Image Loading Fails When Directory Contains "+" Character
I'm having a strange issue with loading images from files using WWW. Depending on the specific folder I load the images from, either everything works, or all the images in the folder fail to load. If I move images from a folder where things don't work to one where things do, those images also load fine. Here is my code:
private IEnumerator ImageLoadCoroutine(int i)
{
GameObject imgObj;
WWW www = new WWW(fileList[i]);
while (!www.isDone)
yield return null;
print("Loading Image: " + www.text);
imgObj = Instantiate(imagePrefab);
imgObj.transform.SetParent(imageContainer.transform);
imgObj.transform.localPosition = Vector3.zero;
imgObj.transform.localRotation = Quaternion.identity;
imgObj.transform.localScale = Vector3.one;
imgObj.GetComponent<RawImage>().texture = www.texture;
imgObj.GetComponent<RawImage>().enabled = false;
imgObj.GetComponent<BoxCollider>().enabled = false;
imagesLoaded++;
imageList[i] = imgObj;
}
Any clues as to what might be going wrong? Thanks!
Just discovered the apparent cause: the image file loading fails when one or more folder names in the directory contain the "+" character. Any idea why this would happen, and how I can load images contained in such folders? This problem seems unique to a newer version of Unity, since I have a compiled version of the program from $$anonymous$$ay 2017 where images still load fine from these directories.