- Home /
Can you load images from outside the resources folder?
I'm developing my game-editor as a windows forms project, and my game-player as a Unity Project. Both of these applications Load the same Game Data, either for editing or for testing. Therefore, I find it conceptually irritating to have to locate the game-data inside of the Unity Project resources folder. I've located my game-data folder outside of both of the project folders. I can load all of my data files using the C# file framework. The only files I can't load are the image files because (as far as I know) they have to be loaded using the unity resources.load method if you want to use the images in a unity application.
Is there a way I can load images from my hard drive to use as textures in unity, without placing them inside of the resources folder?
I've been thinking about this... Could I make it automatically copy the images into the resources folder first?
Answer by aronze · Jul 17, 2015 at 06:07 AM
You can load local file is outside assets folder. Use www.
WWW www = new WWW("file:///User/MyTexture.png");
yield return www;
Additionally, if you want to load aresource inside assets folder but not resources, this case you can use LoadAssetAtPath. Carefully, LoadAssetAtPath only work in UnityEditor.