コード例 #1
0
        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;
        }
コード例 #2
0
        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;
        }
コード例 #3
0
        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);
        }
コード例 #4
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;
        }
コード例 #5
0
 public void InitRemote(IRemoteAssets remoteAssets)
 {
     _remoteinfo = remoteAssets;
 }