示例#1
0
        public void Trigger(Action <bool, IRequest> callback)
        {
            _callback     = callback;
            _webClient    = new FractalscapeWebClient();
            _storageUtils = new StorageUtils();
            var path = Path.Combine(Application.persistentDataPath, _objName);
            var dir  = Path.Combine(Application.persistentDataPath, _dirName);

            _metadataRequestJob = new Job(new Thread(delegate()
            {
                _webClient.GetObjectMetadata(_objName);
            }));
            _downloadRequestJob = new Job(new Thread(delegate()
            {
                _webClient.GetObject(_objName);
            }));
            _unzipPackageJob = new Job(new Thread(delegate()
            {
                _storageUtils.UnzipPackage(path, dir);
            }));
            _localVersion = PlayerPrefs.HasKey(_versionMetadataTag)
                ? PlayerPrefs.GetString(_versionMetadataTag)
                : "0";
            Start();
        }
示例#2
0
        private IEnumerator HandleDownloadRequest()
        {
            StorageUtils.ExpansiveSearch(_objName, _dirName);
            yield return(RequestProcessor.Instance.StartCoroutine(_downloadRequestJob.Start()));

            if (_webClient.CurrentDataDownload.Error)
            {
                _callback(false, this);
            }
            else
            {
                WindowManager.Instance.StartCoroutine(HandleUnpackageRequest());
            }
        }