示例#1
0
 public void CancelDownload()
 {
     http.Close();
     this_app        = null;
     PublicClass.app = null;
     //发送
     send_cmd((byte)VESAL_CMD_CODE.MSG_CMD, "hide");
 }
 async void Update()
 {
     while (true)
     {
         if (isFinished)
         {
             httpDownLoad.Close();
             httpDownLoad = null;
             var savepath = Path.Combine(Application.persistentDataPath, fileName).Replace('\\', '/');
             PlaceUnZipFiles(savepath);
             isFinished = false;
         }
         else
         {
             var state = model.GetState();
             if (httpDownLoad != null)
             {
                 if (httpDownLoad.Progress > 0.3f && httpDownLoad.Progress < 0.5f)
                 {
                     state.tip = $"下载及解压过程中请勿关闭软件[{HumanReadableFilesize((long)(httpDownLoad.fileLength))}/{HumanReadableFilesize(httpDownLoad.TotalLength)}]({HumanReadableFilesize(httpDownLoad.BytePerSecond)}/S)";
                 }
                 else
                 {
                     state.tip = $"{tip}[{HumanReadableFilesize((long)(httpDownLoad.fileLength))}/{HumanReadableFilesize(httpDownLoad.TotalLength)}]({HumanReadableFilesize(httpDownLoad.BytePerSecond)}/S)";
                 }
                 state.progress = httpDownLoad.Progress * 100;
             }
             model.SetState(state);
         }
         await new WaitForEndOfFrame();
     }
 }
示例#3
0
 void OnDisable()
 {
     print("OnDisable");
     http1.Close();
     http2.Close();
     http3.Close();
 }
示例#4
0
    public void OnClick3()
    {
        if (null != m_aUI)
        {
            return;
        }

        if (null != m_aHttpDownLoad)
        {
            m_aHttpDownLoad.Close();
        }
    }
示例#5
0
 void OnDisable()
 {
     print("OnDisable");
     http.Close();
 }
示例#6
0
 public void CannelDownload()
 {
     Debug.Log("-------------------------cancel_download");
     http.Close();
     Application.Quit();
 }