/// <summary> /// 异步加载资源 /// </summary> /// <param name="assetName">资源名</param> private static void LoadAssetAsync(LoadAssetInfo loadAssetInfo) { AssetBundle assetBundle = ReferenceBundle.GetAssetBundle(loadAssetInfo.bundleName); string assetInBundleName = BundleAsset.GetAssetInBundleName(loadAssetInfo.assetName); AssetBundleRequest request = assetBundle.LoadAssetAsync(assetInBundleName); loadAssetInfo.request = request; EnterLoading(loadAssetInfo); }
/// <summary> /// 请求的回调 表明已经加载成功 /// </summary> public void CallCreateAssetBundle() { //Debug.Log("LoadBundleInfo CallCreateAssetBundle " + bundleName); foreach (LoadBundleRequestInfo loadBundleRequestInfo in loadBundleRequestInfoList) { AssetBundle assetBundle = ReferenceBundle.GetAssetBundle(bundleName); loadBundleRequestInfo.onCreateAssetBundle(bundleName, assetBundle, loadBundleRequestInfo.requestId); } RemoveAllBundleRequest(); }