- Home /
How Save Unity AssetBundle From WebServer to Local Storage
I'm very new to unity and I got stuck in storing Asset and also I'm not a native English man so sorry for my English also.
I'm using asset bundle manager of unity and I can load assets from the server when I need them but I don't want to load the assets every time, I wanted to store the asset bundle or the asset in my project so that I can use it later.
currently, I'm using this code for loading a scene from my AssetBundle Server.
using UnityEngine;
using System.Collections;
using AssetBundles;
using System;
public string sceneAssetBundle;
public string sceneName;
IEnumerator Start()
{
yield return StartCoroutine(Initialize());
}
IEnumerator Initialize()
{
DontDestroyOnLoad(gameObject);
AssetBundleManager.SetSourceAssetBundleURL("URL");
AssetBundleManager.SetDevelopmentAssetBundleServer();
var request = AssetBundleManager.Initialize();
if (request != null)
yield return StartCoroutine(request);
AssetBundleLoadOperation request = AssetBundleManager.LoadLevelAsync(sceneAssetBundle, sceneName, true);
if (request == null)
yield break;
yield return StartCoroutine(request);
}
P.S. I've also taken help from this : https://answers.unity.com/questions/437168/write-downloaded-assetbundle-to-local-storage.html
but some of it APIs are deprecated.
Answer by Zetya96 · Mar 16, 2018 at 08:15 PM
Hi!
with WWW, you can download the given assetbundle, and with System.IO.File.WriteAllBytes you can write the downloaded data to a local file, and load that bundle.
Yes, I had already done that. But it's saved file format is not same as asset bundle file format
Your answer

Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
How can I change the Value of a Color through script? 1 Answer
Not able to load decrypted asset bundle 1 Answer
How to calculate CRC from a bundle file? 2 Answers