Hi devs,
I’ve encountered a problem regarding asset bundles… I’m using the LoadFromCacheOrDownload() method from the WWW class. The URL I’m passing to the method is that of a PHP file which in turn returns the asset bundle being asked for (i.e. http:///DownloadFile.php?bundleName=BUNDLENAME&token=TOKEN ). I did this to avoid the situation where a third party could simply enter the URL in the browser and download the asset bundles.
I’ve set a .htaccess file on the directory where I placed the asset bundles to avoid such scenario. The only way to access the asset bundle is via the PHP file. The problem is that the LoadFromCacheOrDownload builds its index based on the asset bundle name and version, like LoadFromCacheOrDownload(http://serverdomain.com/SomethingInHere.unity3d, 1) would translate to [SomethingInHere.unity3d = 1]. Now since the URL I’m passing is always the same, i.e. DownloadFile.php, there is no way for Unity3D to distinguish an asset bundle from its name.
How can I get around this? The only solution that I’m seeing is to implement the caching part myself.
Thanks in advance,
Regards,
Clayton