当前位置:网站首页>Unity downloads files through the server address
Unity downloads files through the server address
2022-07-07 10:49:00 【HCC2017】
public IEnumerator DownLoadToLocal(string downloadingUrl)
{
/// Get download information
UnityWebRequest header = UnityWebRequest.Head(downloadingUrl);
yield return header.SendWebRequest();
if (!header.isHttpError && !header.isNetworkError)
{
Debug.Log(ulong.Parse(header.GetResponseHeader("Content-Length")));
}
/
// Send download request
webRequest = UnityWebRequest.Get(downloadingUrl);
// Set timeout , if webRequest.SendWebRequest() Connection timeout will return , And isNetworkError by true
webRequest.timeout = 30;
yield return webRequest.SendWebRequest();
if (webRequest.isNetworkError)
{
Debug.Log("Download Error:" + webRequest.error);
}
边栏推荐
- ADB utility commands (network package, log, tuning related)
- July 10, 2022 "five heart public welfare" activity notice + registration entry (two-dimensional code)
- 简单易修改的弹框组件
- 2022.7.5DAY597
- BUUCTF---Reverse---reverse1
- Elegant controller layer code
- Gym installation pit records
- Summary of router development knowledge
- 那些易混淆的概念(三):function和class
- Typescript interface inheritance
猜你喜欢
【推荐系统 01】Rechub
Using U2 net deep network to realize -- certificate photo generation program
PHP \ newline cannot be output
[actual combat] transformer architecture of the major medical segmentation challenges on the list --nnformer
ArrayList thread insecurity and Solutions
Socket communication principle and Practice
Is the soft test intermediate useful??
2021 summary and 2022 outlook
SQL Server knowledge gathering 9: modifying data
P1031 [noip2002 improvement group] average Solitaire
随机推荐
[recommendation system 01] rechub
China Southern Airlines pa3.1
P1223 queuing for water /1319: [example 6.1] queuing for water
Common shortcut keys in IDA
Leetcode-560: subarray with sum K
Openinstall and Hupu have reached a cooperation to mine the data value of sports culture industry
2021 summary and 2022 outlook
Find the greatest common divisor and the least common multiple (C language)
BUUCTF---Reverse---reverse1
IO model review
那些易混淆的概念(三):function和class
Network engineer test questions and answers in May of the first half of 2022
Cluster task scheduling system lsf/sge/slurm/pbs based on HPC scenario
seata 1.3.0 四种模式解决分布式事务(AT、TCC、SAGA、XA)
单调性约束与反单调性约束的区别 monotonicity and anti-monotonicity constraint
[installation system] U disk installation system tutorial, using UltraISO to make U disk startup disk
2022.7.4DAY596
【STM32】实战3.1—用STM32与TB6600驱动器驱动42步进电机(一)
深入理解Apache Hudi异步索引机制
Some online academic report websites and machine learning videos