Resources,LoadAll Workaround?

Hi,
Here is my issue, I am trying to make a build that the user can add their own textures using just the folders in the standalone build. They can replace the textures of the wall, floor, ceiling etc.

The first method I have tried (and I think it is the only one that I can actually use) is WWW:

http://docs.unity3d.com/Documentation/ScriptReference/WWW-texture.html[1]

The code I have been using looks like this:

  string url = "file://" + Application.dataPath + "/Images/Level1/Room" + imagePosition + "/Layer2.png";
        WWW www = new WWW (url);
        yield return www;
        www.LoadImageIntoTexture(renderer.material.mainTexture as Texture2D);

OR: Instead of LoadIntoTexture I used

Material[] mats = renderer.materials;

mats[0] = www.texture;

So for one room I am loading in 13 textures, 5 for the room, and 8 for objects inside the room. So if I have, for example, 10 rooms that can be customized, thats 130 textures that I have to load. The resulting issue is that I have series of memory leaks. I think that each time I load a texture it creates an instance and takes up memory that doesn’t get deleted/freed up.

When I couldn’t figure out how to free up memory using code like Resources.UnloadUnusedAssets(); or System.GC, I found resources.loadall and it worked great with no memory issues. However I could only load assets from the resources folder inside the project folder, but not the standalone player. I do not believe there is a way to make a directory of images into an asset from just the standalone player? Or if there is something similar to Resources.LoadAssets() but instead load assets from a folder that is not Resources? It is essential for my project to be able to all the adjustments from the standalone player only.

So the bottom line is, I need to be able to load a lot of external textures using only the standalone player without using up a lot of memory.

Please help!

Thank you,
Joe

You could use a FileStream from System.IO, read in a byte array and then use one of the Texture2D functions to load that byte array.