Пример #1
0
 public void CancelDownload()
 {
     http.Close();
     this_app        = null;
     PublicClass.app = null;
     //发送
     send_cmd((byte)VESAL_CMD_CODE.MSG_CMD, "hide");
 }
Пример #2
0
 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();
 }