* I have a bundle of about 10 .bytes files.
* I follow the Unity WWW example.
* I get www.isDone=true, and www.bytesDownloaded is the correct size, so it downloads something.
* www.assetBundle is always null.
* I use Dropbox Public folder as Server.
* I get no error messages.
void Start()
{
StartCoroutine(LoadBundle());
}
IEnumerator LoadBundle()
{
string downloadPath = FilePath.Url() + FilePath.Dir +
DataLib.AssetBundlesDir + FilePath.Dir + "mainbundle";
using (WWW www = new WWW(downloadPath))
{
yield return www;
if (www.error != null)
throw new Exception("WWW download had an error:" + www.error);
AssetBundle bundle = www.assetBundle;
Debug.Log("wwwResult: is done: " + www.isDone.ToString() +
", progress: " + www.progress.ToString() + ", bytesDownloaded: " + www.bytesDownloaded.ToString());
// www.isDone is true
//www.bytesDownloaded are correct
//but www.assetBundle is Null
}
}
↧