public IEnumerator LoadAllDependenciesAsync(string fname, int ttl) { if (manifest == null) { LogUtil.Error("manifest == null"); yield break; } string dpname = fname.Replace("\\", "/"); // Get dependecies from the AssetBundleManifest object.. string[] dependencies = manifest.GetAllDependencies(dpname); var length = dependencies.Length; if (length == 0) { yield break; } // Record and load all dependencies. var count = (float)length; for (int i = 0; i < length; i++) { var depend = RemapVariantName(dependencies[i]); LogUtil.Trace(fname + ":dependancy:" + depend); var iter = BundleManager.LoadAsync(fname, depend, ttl); while (iter.MoveNext()) { yield return(null); } } }
private static IEnumerator _LoadAsync(string uri, int ttl, Action <AssetBundleRef> onComplete) { #if PROFILE_FILE // Profiler.BeginSample("BundleHelper._LoadAsync"); #endif var fixedUri = fixBundleUri(uri); AssetBundleRef assetBundle = null; var iter = BundleManager.LoadAsync(null, fixedUri, ttl); var count = 0; while (iter.MoveNext()) { count++; yield return(null); } assetBundle = BundleManager.GetBundleRef(fixedUri); onComplete(assetBundle); #if PROFILE_FILE // Profiler.EndSample(); #endif }
private static IEnumerator _LoadAsync(string uri, int ttl, LuaTable lua) { #if PROFILE_FILE // Profiler.BeginSample("BundleHelper._LoadAsync"); #endif var fixedUri = fixBundleUri(uri); var iter = BundleManager.LoadAsync(null, fixedUri, ttl); var count = 0; while (iter.MoveNext()) { count++; yield return(null); } if (lua != null) { lua.setOneLevelField("bundle", BundleManager.GetBundleRef(fixedUri)); } #if PROFILE_FILE // Profiler.EndSample(); #endif }