bool AddStreamAtPath(ref AssetBundleContext context, string assetpath) { if (File.Exists(assetpath)) { IParseDependencyReader reader = AssetBundleTypeGetter.GetDepReader(); if (reader != null) { if (reader.IsAsync) { Block = true; GUpdater.mIns.StartCoroutine(TryRead(reader, assetpath)); } else { List <AssetBundleInfo> list; if (reader.Read(assetpath, out list)) { context.Cache.Load(list); ListPool <AssetBundleInfo> .Release(list); } return(true); } } } return(false); }
bool AddPersistentAtPath(ref AssetBundleContext context, string assetpath) { if (File.Exists(assetpath)) { IParseDependencyReader reader = AssetBundleTypeGetter.GetDepReader(); if (reader != null) { List <AssetBundleInfo> list; if (reader.Read(assetpath, out list)) { context.Cache.Load(list); ListPool <AssetBundleInfo> .Release(list); } return(true); } } return(false); }
IEnumerator TryRead(IParseDependencyReader reader, string filepath) { yield return(reader.ReadAsync(filepath)); AssetBundleFeature assetfeature = Parent as AssetBundleFeature; if (assetfeature != null) { DefaultParseDepReader depReader = reader as DefaultParseDepReader; if (depReader != null) { AssetBundleContext context = assetfeature.StartRead(); context.Cache.Load(depReader.AsyncResultList); ListPool <AssetBundleInfo> .Release(depReader.AsyncResultList); depReader.AsyncResultList = null; assetfeature.EndRead(ref context); } } Block = false; }