Example #1
0
        public DownloadMission(uint id, string taskExt)
        {
            string url = getDownInfo(taskExt);

            _taskId = id;
            string apkName    = System.IO.Path.GetFileName(url);
            ulong  playerId   = GameDataManager.Instance.PlayerAccId;
            string missionTag = "mission" + Scripts.CoreScripts.Core.Util.Utils.getMD5(playerId.ToString() + _taskId.ToString());
            string path       = Application.persistentDataPath + "/" + missionTag + apkName;

            _fdl = new ZUpdate.FileDownLoad(url, path, null);
            _fdl.Start(CaleSizeCallBack, ZUpdate.FileDownLoad.Action.CalcSize);
        }
Example #2
0
 void DownLoadCallBack(ZUpdate.FileDownLoad fdl)
 {
     if (fdl.state == ZUpdate.FileDownLoad.State.Doing)
     {
         notify(DownloadDoing);
     }
     else if (fdl.state == ZUpdate.FileDownLoad.State.Completed)
     {
         notify(DownloadComplete);
     }
     else if (fdl.state == ZUpdate.FileDownLoad.State.Failed)
     {
         notify(DownloadFailed);
     }
 }
Example #3
0
 void CaleSizeCallBack(ZUpdate.FileDownLoad fdl)
 {
     if (fdl.state == ZUpdate.FileDownLoad.State.Doing)
     {
         notify(CaleSizeDoing);
     }
     else if (fdl.state == ZUpdate.FileDownLoad.State.Completed)
     {
         notify(CaleSizeComplete);
     }
     else if (fdl.state == ZUpdate.FileDownLoad.State.Failed)
     {
         notify(CaleSizeFailed);
     }
 }