예제 #1
0
        void Awake()
        {
            GameObject obj = new GameObject("_WebDownload");

            obj.transform.SetParent(transform);
            //使用 HttpWebRequest
            _webDownload = obj.AddComponent <HttpWeb>();

            //使用 UnityWebRequest
            _webDownload = obj.AddComponent <UnityWeb>();
        }
예제 #2
0
        public void CheckUpdate(string module, bool isGetSize, Action <Md5File, long> complete)
        {
            _isGetSize = isGetSize;
            _complete  = complete;

            new DownloadMd5File(module, DownloadMd5FileComplete);

            GameObject obj = new GameObject("_WebDownload");

            obj.transform.SetParent(transform);
            _webDownload = obj.AddComponent <UnityWeb>();
        }
예제 #3
0
        public AppParser(IWebDownload download, JsonSerializerSettings serializerSettings,
            int truncateLimit, MatchOptions segmentMatchOptions, ProgramSettings settings) {
            this.download = download;
            this.serializerSettings = serializerSettings;
            this.truncateLimit = truncateLimit;
            this.segmentMatchOptions = segmentMatchOptions;
            this.settings = settings;

            // Debug下为了Fiddler的Auto Responder能稳定拦截请求,需要对id进行排序
            if (settings.Debug) {
                this.output = new SortedSet<int>();
            }
            else {
                this.output = new HashSet<int>();
            }
        }
예제 #4
0
 public DownloadObj SetWebDownload(IWebDownload webDownload)
 {
     this.webDownload = webDownload;
     return(this);
 }
예제 #5
0
        private SGameUpdaterCallback m_downloadCallback;                           //下载资源回调函数Table
        #endregion

        #region 构造方法
        public GameUpdater(SGameUpdaterCallback scallback)
        {
            m_downloadFailConfigList = new List <SGameUpdaterDownloadConfig>();
            m_downloader             = new GameObject("GameUpdater").AddComponent <UnityWeb>();
            m_downloadCallback       = scallback;
        }
예제 #6
0
 /// <summary>
 /// Cancel a DownloadObject but do not remove from queue.
 /// </summary>
 public void Cancel(IWebDownload download) => download.Cancel();