Quantcast
Channel: Questions in topic: "assetbundle"
Viewing all articles
Browse latest Browse all 1593

How to download Assetbundles and put them into a particular folder in WEBGL

$
0
0
Actually i am trying to make asset bundles of my sprites and load them into the server. i have successfully created the asset bundles for WEBGL platform now i want it to be loaded on runtime and to be saved in a particular folder eg., Resources or Streaming Assets. so that i can load a particular sprite just by calling its path static void BuildAllAssetBundles() { string assetBundleDirectory = "Assets/AssetBundles"; if (!Directory.Exists(assetBundleDirectory)) { Directory.CreateDirectory(assetBundleDirectory); } BuildPipeline.BuildAssetBundles(assetBundleDirectory, BuildAssetBundleOptions.None, BuildTarget.WebGL); } this is the code which i used to generate asset bundles void Start () { StartCoroutine ("LoadAssets"); } IEnumerator LoadAssets() { string uri = Path.Combine(Application.dataPath, "/AssetBundles/" + "model"); UnityWebRequest request = UnityWebRequestAssetBundle.GetAssetBundle(uri, 0); yield return request.SendWebRequest(); AssetBundle bundle = DownloadHandlerAssetBundle.GetContent(request); } } this is the code which i am using to save these assets into AssetBundles folder... but i am unsuccessfull please give me some correct method for doing this

Viewing all articles
Browse latest Browse all 1593

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>