0

I'm new to Unity. Now I have an image folder which includes around 749 .jpg images. I want to create an assetbundle of this folder. In the game, I want to load these .jpg iamges one by one and set it as Texture2D.

Thanks in advance.

2 Answers2

0

After downloading asset bundle either by WWW or WWW.LoadFromCacheOrDownload do this:

WWW www = new WWW(url);//download aaset
                AssetBundle assetBundle = www.assetBundle;
                AssetBundleRequest request = assetBundle.LoadAssetAsync<Image>("nameOfImage");
                Texture texture = request.asset as Textute;

put this code under IEnumerator and yeild return www;

Aryaman Gupta
  • 616
  • 1
  • 8
  • 20
-1

You can find full guide on Unity Blog(how to make and load asset bundles) as it said:

AssetBundles are files created in the Unity editor during edit-time, which can be used later by a build of a project at run-time. AssetBundles can contain asset files such as models, materials, textures and scenes. AssetBundles cannot contain scripts. (Read This)

Muhammad Faizan Khan
  • 10,013
  • 18
  • 97
  • 186