Import a file at runtime....possible?

I’d like for my users to be able to import a file ( probably an xml file ) into the game that I can read and do something with.

Is this even possible?

Yes, put it into “Resources” folder.

1 Like

Resources folder is not something that your users will be able to access after the game has been built, but it is the standard depot for files you use for the game.

Alternatively, you can also load files at runtime from the StreamingAssets folder which is accessible directly from your game directory post-build. You’ll find it in your Assets/ folder pre-build.

4 Likes

Yes. Depending on your platform and contents there are a bunch of different ways to do things. StreamingAssets, asset bundles, and System.IO are all good places to start your search.

2 Likes

Why noone mentioned WWW? It can open file and you can get .bytes of it (it’s not good for streaming bytes though - it’ll load whole file before bytes are accessible).

3 Likes

The easiest way I can see is to make it create a folder where the game is located. Then have it pretty much copy over to the folder, then make a list function read the contents of the folder and select which one.

But that’s what I’d do, may not be the best way for localized streaming.

1 Like

n1warhead this sounds interesting… although my first thought is this wouldnt work on mobile devices…right?