- Home /
Loading Asset Bundle from raw bytes
Hello all,
Is there a way to load an asset bundle from raw bytes? In the documentation, it seems that the only way to load one is by using the www class. (One usecase for this would be to send a bundle over the network to someone else.)
Very good question. I see a lot of cases where you would need something like that, but i guess it's not possible since the only way (that i know) is to load it via WWW.
There would be a trick that might work for standalone builds by simulating a web-server and use www to load it from itself :D. But in Web-build that's impossible since you can't act as a server (except with Unitys Networking but you can't simulate a web server with it).
Hm, okay... so that would mean the only way is to somehow save the binary data and then access it via WWW (may it be a temporary file on disk, first sending it to a php script and getting an url, or something else).
Usually assetbundles are ment to be loaded from a webserver or from disk (in standalone builds). If you build for the webplayer it's easier for each client to load the bundles from your server. I guess you don't want to setup some kind of cloud-network between the clients... xD.
In standalone build you also need a source where the bundle comes from. Either from a webserver as some kind of "update" or from disk as a user-extention / mod.
Where does your bundles come from?