- Home /
asset bundle create and download from server(IOS)
Hi unity pro guys, My Requirement is create asset bundle from unity for iOS and download them from server and display in my app..i have some 3d object which i downloaded from asset store so how can i create asset bundle from Prefabs and what is the best method to download it..i tried "LoadFromCacheOrDownload" method..but got failed load data error....can any one suggest me from beginning...what shd i do..?
thanks in advance.
Answer by gheeler · Aug 29, 2013 at 08:55 AM
Im guessing you have the assetbundle script on this page? http://docs.unity3d.com/Documentation/Manual/BuildingAssetBundles.html
you need to build seperate assetbundles for ios and android so you need to add another variable to the BuildPipeline.BuildAssetBundle call
BuildPipeline.BuildAssetBundle(Selection.activeObject, selection, path, BuildAssetBundleOptions.CollectDependencies | BuildAssetBundleOptions.CompleteAssets, BuildTarget.iPhone);
thank for ur reply...but i saved bundle in my ios directory..and use this code for displaying object... But cant see any object in screen....
BundleURL = "file://" +Application.persistentDataPath+"/"+"base$$anonymous$$aleBundle.iphone.unity3d"; print ("Trying to load Bundle" + BundleURL); www = new WWW(BundleURL); yield return www; Debug.Log("Loaded "); if (www.error != null) throw new Exception("WWW download had an error: " + www.error); AssetBundle assetBundle = www.assetBundle; Instantiate(assetBundle.mainAsset); assetBundle.Unload(false);
Your answer
Follow this Question
Related Questions
Yield return in AssetBundle.CreateFromMemory 0 Answers
A node in a childnode? 1 Answer
how to create car wheel impression on ground in unity3d? 1 Answer
How to import the object from server to unity 2 Answers
Asset Bundle Download Problem 0 Answers