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(); } }
void OnDisable() { print("OnDisable"); http1.Close(); http2.Close(); http3.Close(); }
public void OnClick3() { if (null != m_aUI) { return; } if (null != m_aHttpDownLoad) { m_aHttpDownLoad.Close(); } }
void OnDisable() { print("OnDisable"); http.Close(); }
public void CannelDownload() { Debug.Log("-------------------------cancel_download"); http.Close(); Application.Quit(); }