x


How can I load texture files that are outside of my project folders?

What I am trying to is be able to let a player drop custom texture files into a folder and be able to read those texture into my game. The folder sits in the same directory as the game executable, but I can't seem to get the WWW class to work on relative folders and Resources.Load only works on files within the project. Can anyone help me out here?

more ▼

asked Jan 29 '12 at 09:26 PM

benjaben gravatar image

benjaben
31 11 13 15

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

You can use

Directory.GetCurrentDirectory();

to find the local path, and then you can append the path of your external images and use a WWW with the file:// protocol to load them.

Or, you can use .net IO stuff to load the bytes of a file directly, but that doesn't have quite as much functionality as Unity's WWW class.

more ▼

answered Jan 29 '12 at 10:31 PM

syclamoth gravatar image

syclamoth
14.8k 7 15 80

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2197
x525
x436
x218

asked: Jan 29 '12 at 09:26 PM

Seen: 1080 times

Last Updated: Jan 29 '12 at 10:31 PM