I know these are pretty much all pro features, but i’m curious to know whether you can have a webplayer that streams in certain assets and saves them/caches them somewhere so that the next time you play, them don’t need to be re-downloaded? If it can’t be done in webplayer, can it be done in standalone?
I don’t think there is anything right now that would prevent you from implementing something similar for standalone – webplayer, on the other hand, is not currently possible. That said, this feature has been announced in the Unity product roadmap (see the blog post) within the 2.x cycle.
Well, the web player itself doesn’t cache… But the browser does.
When you download the .unity3d file it’s saved to the browser cache. If all your assets are in your build, it’s cached when your browser downloads it. If you flush the browser cache, they will be re-downloaded next time, but as long as the build itself hasn’t changed and your browser cache is intact (and big enough to store your build along with the rest of the stuff you might be watching with your browser) - in theory instead of downloading the build again, it will be read by your browser from the cache. I imagine browsers have other parameters (for example, if you haven’t viewed that file for a couple of days, it might be marked as “old” and will be re-downloaded) that will determine if the file is read from the disk or downloaded again.
You can’t rely on it, but it does help sometimes.
I don’t know how it’s supposed to work if you use asset bundles, stream using the WWW class or publish your build as a streamed web player, but I imagine it’s pretty much the same.
[quote="cyb3rmaniak"I don’t know how it’s supposed to work if you use asset bundles, stream using the WWW class or publish your build as a streamed web player, but I imagine it’s pretty much the same.[/quote]
It is the same, content in the browser is downloaded to the browser’s cache and is only there until the cache gets flushed, the content gets pushed out, etc.
It can by browser cache technology as mentored above.
More explained idea is:
-
You have command stream between Unity webplayer and some server (on System.XML or other base) PHP, PDS, SmartFox, etc.
-
Unity webplayer got command by channel 1) to load some *.unity3d file from somewhere by http protocol.
-
Unity webplayer drop API request to browser, which starts to download *.unity3d file and add it to local cache before give it to webplayer.
It is not tested, but soon. Correct me please if explained algorithm have some mistake.
First aware of mistake possibility, is probable that WWW class not use Browser proxy settings (see http://forum.unity3d.com/viewtopic.php?p=221590#221590 )