public AssetBundleCache(int capacity) { _assetBundleInfoDict = DictionaryPool <IgnoreCaseString, AssetBundleInfo> .Get(); _assetbundleDictionary = DictionaryPool <IgnoreCaseString, GameAssetBundle> .Get(); _exceptionHashSet = HashSetPool <IgnoreCaseString> .Get(); _assetbundleincludes = DictionaryPool <string, List <string> > .Get(); _remoteinfo = null; }
IEnumerator ParseRemote(string url) { yield return(_remote.Init(url)); if (_remote.IsDone) { AssetBundleFeature assetfeature = Parent as AssetBundleFeature; if (assetfeature != null) { var context = assetfeature.StartRead(); context.Cache.InitRemote(_remote); _remote = null; assetfeature.EndRead(ref context); } } Block = false; }
public int Init(ref AssetBundleContext context) { if (_remote == null) { string url = AssetBundleConfig.DownloadUrl; _remote = AssetBundleTypeGetter.GetRemoteAssets(); GUpdater.mIns.StartCoroutine(ParseRemote(url)); } Block = !_remote.IsDone; if (_remote.IsDone) { context.Cache.InitRemote(_remote); _remote = null; } return(0); }
public void Dispose() { if (_assetBundleInfoDict != null) { DictionaryPool <IgnoreCaseString, AssetBundleInfo> .Release(_assetBundleInfoDict); _assetBundleInfoDict = null; } if (_assetbundleDictionary != null) { DictionaryPool <IgnoreCaseString, GameAssetBundle> .Release(_assetbundleDictionary); _assetbundleDictionary = null; } if (_assetbundleincludes != null) { foreach (var item in _assetbundleincludes) { ListPool <string> .Release(item.Value); } DictionaryPool <string, List <string> > .Release(_assetbundleincludes); _assetbundleincludes = null; } if (_exceptionHashSet != null) { HashSetPool <IgnoreCaseString> .Release(_exceptionHashSet); _exceptionHashSet = null; } _remoteinfo = null; }
public void InitRemote(IRemoteAssets remoteAssets) { _remoteinfo = remoteAssets; }