public IEnumerator LoadAssetBundleNoCache(string package, AssetBundleLoadDelegate loadCallBack) { while (!Caching.ready) { yield return(null); } string loadPath = string.Format("{0}/{1}.{2}", localRoot, package, bundleExt); Debug.Log(loadPath); using (WWW www = WWW.LoadFromCacheOrDownload(loadPath, version)) { yield return(www); AssetBundle assetBundle = www.assetBundle; yield return(StartCoroutine(loadCallBack(assetBundle))); assetBundle.Unload(false); www.Dispose(); } yield return(null); }
public IEnumerator LoadAssetBundle(string package, AssetBundleLoadDelegate loadCallBack) { if (!assetBundleDict.ContainsKey(package)) { yield return(StartCoroutine(LoadAssetBundle(package))); } AssetBundle assetBundle = null; assetBundleDict.TryGetValue(package, out assetBundle); if (assetBundle == null) { yield break; } yield return(StartCoroutine(loadCallBack(assetBundle))); }