- Home /
Accessing Local Computer Files
What I would like to do is access the computer files after saying something in the textfield. This will be used as a fun widget for me to play around with, just an example. I would prefer javascript, but if you have to C#. I looked at a couple of Unity Answers about this, but haven't really understood much of it xD, so I decided to put it all in my own words. Just a textfield, when you type in something like, "/move Minecraft Desktop" it moves the file "Minecraft" to your Desktop. Thanks!
Here is free file browser using c# code C# File Browser in asset store or C# File Browser in mega.co.nz
This File Browser is easy to use. In my game this file browser with few modification is using for image uploader .
For Android
File -> Build Settings ->Player Settings
Inspector -> Other Settings -> Configuration -> Write Access ->External( sdcard)
Answer by gribbly · Jan 16, 2013 at 03:06 AM
You can do as an editor extension:
http://docs.unity3d.com/Documentation/ScriptReference/FileUtil.html
Otherwise Unity is sandboxed and can't really access the local filesystem (by design). You can do .txt file stuff here:
http://docs.unity3d.com/Documentation/ScriptReference/TextAsset.html
EDIT: Oops, Bunny83 is right, only the web player is sandboxed. OP have a look here:
http://msdn.microsoft.com/en-us/library/system.io.file.aspx
...there's some sample code near the bottom of the page you can try.
Unity isn't sandboxed, only the webplayer and of course a flash build is. All other builds can access any file you like with the System.IO
stuff.
On some platforms some special options are available.
For example on Android build you have to specify in the settings that you want access the filesystem. In this case the user is informed about that when installing your app.
Accessing files has actually nothing to do with Unity. It's just a plain .NET feature which you can use in Unity the same way as in other C# (or any other .NET language) application.
Answer by Blasfemmy · Jan 16, 2013 at 03:04 AM
For moving around files on your desktop, why not just write up a basic java applet?
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Accessing local system ( File Browser ) 2 Answers
How can I change my game type to a .unity3d file? 1 Answer
If statement PLZ HELP!!!! 2 Answers
WebGL on file:/// 0 Answers