Question by
Ssushrut · Nov 20, 2017 at 12:41 PM ·
androidassetbundleassetbundles
AssetBundle Manager Doesn't fetch assetBundle on Andriod
I'm trying to implement AssetBundles using AssetBundleManager it's working fine on PC but, on Android it fails with following error
Failed downloading bundle Android from Android: java.net.MalformedURLException: Protocol not found: Android
Here's code i'm using
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using AssetBundles;
public class loadprefabs : MonoBehaviour
{
IEnumerator Start()
{
yield return StartCoroutine(initilize());
yield return StartCoroutine(loadObjs());
}
IEnumerator initilize()
{
AssetBundleManager.SetSourceAssetBundleURL("http://www.<myDomain>.com/cloud/");
var request = AssetBundleManager.Initialize();
if (request != null)
yield return StartCoroutine(request);
}
IEnumerator loadObjs()
{
AssetBundleLoadAssetOperation req = AssetBundleManager.LoadAssetAsync("prefabs", "Cube", typeof(GameObject));
if (req == null)
yield break;
yield return StartCoroutine(req);
GameObject prefab = req.GetAsset<GameObject>();
if (prefab != null)
GameObject.Instantiate(prefab);
}
Comment
Your answer
Follow this Question
Related Questions
Problem with AssetVundle and ScriptableObjects 0 Answers
Asset Bundle error 0 Answers
AssetBundle Textures not loading 0 Answers
Asseatbundle Local Download for android path problem 0 Answers