Hi guys
I want to make assets bundle for ios .i have done for web player but when i download that bundle for ios it show me error
> he file can not be loaded because it was created for another build target that is not compatible with this platform.
Please make sure to build asset bundles using the build target platform that it is used by.
File's Build target is: 6
(Filename: Line: 625)
Failed to read file 'none' because it is corrupted.
(Filename: Line: 444)
The asset bundle 'https://dl.dropboxusercontent.com/u/76813056/Bundles/Bundle.unity3d' can't be loaded because it was not built with the right version or build target.
here is my code for making assets bundle
using UnityEngine;
using UnityEditor;
public class ExportAssetBundles {
[MenuItem("Assets/Build AssetBundle From Selection - Track dependencies")]
static void ExportResource () {
// Bring up save panel
string path = EditorUtility.SaveFilePanel ("Save Resource", "", "New Resource", "unity3d");
if (path.Length != 0) {
// Build the resource file from the active selection.
Object[] selection = Selection.GetFiltered(typeof(Object), SelectionMode.DeepAssets);
BuildPipeline.BuildAssetBundle(Selection.activeObject, selection, path, BuildAssetBundleOptions.CollectDependencies | BuildAssetBundleOptions.CompleteAssets);
Selection.objects = selection;
}
}
[MenuItem("Assets/Build AssetBundle From Selection - No dependency tracking")]
static void ExportResourceNoTrack () {
// Bring up save panel
string path = EditorUtility.SaveFilePanel ("Save Resource", "", "New Resource", "unity3d");
if (path.Length != 0) {
// Build the resource file from the active selection.
BuildPipeline.BuildAssetBundle(Selection.activeObject, Selection.objects, path);
}
}
}
and for getting assets code is
IEnumerator Start()
{
//float timebefore;
//float timeafter;
//StartCoroutine("CheckInternetWorking");
// Download the file from the URL. It will not be saved in the Cache
using (www = new WWW(BundleURL))
{
yield return www;
if (www.error != null)
{
Debug.Log("error = "+www.error);
}
AssetBundle bundle = www.assetBundle;
Instantiate(bundle.mainAsset);
bundle.Unload(false);
}
}
please help me i am in trouble ,i want to make a assets bundle for ios and load on device
and sorry for my english
Thanks in advance
↧