I am new in Unity and and I start to use AssetBundle for my project to download them from server. I use UnityWebRequestAssetBundle to download the assets because WWW is obsolete. Everything is works fine I can download the assets from the server put it into the persistentDataPath and I can load them to the scene without any problem. But then I realised that there may be a chance when the model is get updated so I also need to update it in the app. I know there is a manifest file for every asset in the assetbundle so when I download the asset I also download the manifest file. I do everything as the Unity documentation but I always get this error:
unable to read header from archive file: /manifest/location
The manifest download method looks like this:
IEnumerator GetManifest(string animal)
{
using (UnityWebRequest uwr = UnityWebRequestAssetBundle.GetAssetBundle("http://weppage.com/" + asset + ".manifest"))
{
uwr.downloadHandler = new DownloadHandlerFile(path + "/" + asset + ".manifest");
yield return uwr.SendWebRequest();
if ( uwr.isNetworkError || uwr.isHttpError )
{
Debug.Log(uwr.error);
}
}
}
Then there is the check method after download:
AssetBundle manifestBundle = AssetBundle.LoadFromFile(Path.Combine(path, asset));
AssetBundleManifest manifest = manifestBundle.LoadAsset<AssetBundleManifest>("asset.manifest");
I'm totally lost. I go through the google and I can't get it work. I don't get why it isn't work. I load the asset the same way without any problem and Unity docs said it have to work the same way. From Unity docs: Loading the manifest itself is done exactly the same as any other Asset from an AssetBundle