public static IEnumerator DownLoadAssetBundle(string bundleName, OnLoadBundleFinish onLoadBundleFinish) { ResourceAPI resourceAPI = SimpleFactory.CreateResourceAPI(); DownLoadEventAPI downLoadEventAPI = SimpleFactory.CreateDownLoadEventAPI(); downLoadEventAPI.OnLoadBundleDelegate += onLoadBundleFinish; yield return(resourceAPI.LoadAssetBundle(bundleName, downLoadEventAPI)); }
IEnumerator CreateIEnumerator() { ResourceAPI resourceAPI = SimpleFactory.CreateResourceAPI(); DownLoadEventAPI downLoadEventAPI = SimpleFactory.CreateDownLoadEventAPI(); downLoadEventAPI.OnLoadBundleDelegate += (AssetBundle bundle) => { UIPackage.AddPackage(bundle); this.Inst <WindowManage>().OpenWindow(WindowNameFactory.GetLoginWindowName()); }; yield return(resourceAPI.LoadAssetBundle(BundleConst.WindowframeBundleName, downLoadEventAPI)); }
public IEnumerator LoadAssetBundle(string keyName, DownLoadEventAPI combineLoadHelp) { AssetBundle assetBundle = null; bool hasBundle = bundlelist.ContainsKey(keyName) && bundlelist[keyName].Bundle != null; if (!hasBundle) { DownLoadHelpAPI downLoadHelp = SimpleFactory.CreateDownLoadHelpAPI(); yield return(DownLoadAsset(keyName, downLoadHelp)); } if (bundlelist.ContainsKey(keyName)) { assetBundle = bundlelist[keyName].PlusCount(); } if (assetBundle != null) { combineLoadHelp.OnLoadAssetBundle(assetBundle); } yield return(null); }