Esempio n. 1
0
 public void DownLoad(string module)
 {
     if (G_Table == null)
     {
         G_Table = LuaEnvMgr.Instance.LuaEnv.Global.Get <DownloadModuleTable>("G_DownloadModuleMgr");
     }
     this.DownLoadHandler(module, G_Table);
 }
Esempio n. 2
0
 public void Download(string module, Queue <DownloadConfig> list, CheckForUpdate checkForUpdate, DownloadModuleTable table)
 {
     _table          = table;
     _downloadList   = list;
     _module         = module;
     _checkForUpdate = checkForUpdate;
     if (_downloadList.Count > 0)
     {
         _downloadCount  = _downloadList.Count;
         _isWriteMd5File = true;
         _thread         = new ThreadDownload(_downloadList);
         _thread.Start();
     }
 }
Esempio n. 3
0
 private void OnDestroy()
 {
     if (_isWriteMd5File)
     {
         _checkForUpdate.WriteToLocalFile(_module);
     }
     if (_thread != null)
     {
         _thread.Stop();
     }
     _checkForUpdate = null;
     _thread         = null;
     _downloadList   = null;
     _table          = null;
 }
Esempio n. 4
0
 public void DownLoadHandler(string module, DownloadModuleTable table)
 {
     //CheckForUpdateMgr.Instance.CheckModule(module);
     if (GameConfig.gameModel == GameModel.Editor)
     {
         if (table != null)
         {
             table.Complete(module);
         }
         return;
     }
     new CheckForUpdate(module, (CheckForUpdate checkForUpdate, Queue <DownloadConfig> list) =>
     {
         if (list == null)
         {
             if (table != null)
             {
                 table.Error(module);
             }
             return;
         }
         if (list.Count > 0)
         {
             DownloadModule dm = new GameObject("DownloadModule", typeof(DownloadModule)).GetComponent <DownloadModule>();
             dm.transform.SetParent(transform);
             DontDestroyOnLoad(dm.gameObject);
             dm.Download(module, list, checkForUpdate, table);
         }
         else
         {
             if (table != null)
             {
                 table.Complete(module);
             }
         }
     });
 }
Esempio n. 5
0
 public void DownLoadForCS(string module, DownloadModuleTable CSTable)
 {
     this.DownLoadHandler(module, CSTable);
 }