|
With the latest release of Native Client, it now supports disk I/O. This I/O is different than System.File.IO in that it's asynchronous, more analogous to WWW in Unity terminology. From https://developers.google.com/native-client/beta-docs/fileIO
My question is: is there any way to access this functionality from a Unity project compiled for NaCl? Google does provide an example C++ read/write class at http://code.google.com/p/nativeclient-sdk/source/browse/trunk/src/examples/pong/pong.cc, but I have zero experience with C++. We can't just compile this code to a plugin, because as Unity says: "As with the standard webplayer plugin, native C/C++ plugins are not currently supported by NaCl."
(comments are locked)
|
|
I posted this to the forums as well, and a Unity Developer was kind enough to provide an answer:
You can read the whole thing here: http://forum.unity3d.com/threads/124820-File-I-O-in-Native-Client
(comments are locked)
|
|
It would be helpful if Unity would post a technical page that explains exactly which NaCl features can be leveraged in Unity and some sample code of how to leverage them. Being able to read/write from disk is a very powerful NaCl feature and would be extremely useful to Unity developers. UnityAnswers etiquette is that opinions should be posted as comments rather than an answer. This helps with the flow of the Q&A. I agree that a page of explanation of Unity in NaCl and what is/isn't implemented would be very useful. However, it sounds like NaCl support is still very much in development/flux, so I don't honestly expect anything for a while.
Mar 01 '12 at 12:28 AM
Julien.Lynge
My humble apologies for the breach in etiquette.
Mar 09 '12 at 08:23 PM
jeffssmith1
(comments are locked)
|
|
This is not a question about if it's possible or not. It just doesn't allow you to access local files! All Unity players (standalone / webplayer / Android) are written in native code. In this case there's no problem for the player itself to access everything on the clients PC. The point is that unity created games / apps that are played in the Webplayer aren't allowed to access files. The Unity3d Webplayer is a trusted piece of software which has to be installed on the clients PC. A game embedded in a website isn't trusted software. There is no way for content that runs in the Unity webplayer to access local files. There is, will and should be no way to do something like that. The best i could think of if some kind of drag and drop support, so the user fully controls what files can be read. Here's a feature request for this functionality I'm not sure I agree with your assessment here. The other webplayer instances have no I/O access because they're sandboxed - it's just not possible to do. Here, NaCl has provided the functionality - it's not random I/O, it's an intentionally 'safe' way that Google has decided to block off disk space within the Native Client sandbox. I've never seen a statement from Unity that they simply won't allow disk access from webplayer if there are no technical limitations. Furthermore, at this point we're no longer talking about a strict unity webplayer with the trust issues you imply - according to Unity: "Unity 3.5 offers support to run Unity Web Player content (.unity3d files) using NaCl to allow content to be run without requiring a plugin install in Chrome." Thus they're providing a wrapper into Native Client, not a browser plugin, and the app is distributed through the Chrome app store. This is somewhat analogous to the iOS/Android model, and Unity certainly doesn't restrict disk access there.
Feb 23 '12 at 10:35 PM
Julien.Lynge
(comments are locked)
|
