- Home /
AssetBundle Android
Hi. How to use assetbundle to download additional data on android devices. I tried with this code
string url = "http://www.mywebsite.com/mygame/assetbundles/assetbundle1.unity3d";
IEnumerator Start () {
// Start a download of the given URL
WWW www = WWW.LoadFromCacheOrDownload (url, 1);
// Wait for download to complete
yield return www;
// Load and retrieve the AssetBundle
AssetBundle bundle = www.assetBundle;
}
and with a lot of codes founds on forum but in the sd card is a single foder named files and assetbundle wont load.
Please tell me how to do. thanks
Are you getting any specific error messages? If so, please post them.
Answer by ultramatrix · Mar 30, 2012 at 10:18 AM
i have problem too. no error messages. all works on PC/MAC/EditorPC... Also works when project switched in Android platform.
no work on Android device! file is present in forlder assets in APK. file loaded but not create in scene. for example java script:
var download : WWW;
var url = "jar:file://" + Application.dataPath + "!/assets/man.unity3d";
var ab : AssetBundle;
var instanced : Object;
if (Application.platform == RuntimePlatform.Android)
download = new WWW (url);
yield download;
ab = download.assetBundle;
go : Object = ab.mainAsset;
instanced = Instantiate(go);
Work on WindowsEditor (switched to Android platform) - In scene shows man.unity3d. And not worked on Android device (apk file). No object of man.unity3d in scene. but file man.unity3d present in apk file in folder assets.
If write RuntimePlatform.WindowsPlayer worked in editor and compiled exe.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
What is wrong with this script? 2 Answers
pause menu on android phone 1 Answer
qrest system 1 Answer
Having problems with my timer 1 Answer