当前位置:网站首页>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);
}
边栏推荐
- Those confusing concepts (3): function and class
- [installation system] U disk installation system tutorial, using UltraISO to make U disk startup disk
- Some superficial understanding of word2vec
- 【STM32】实战3.1—用STM32与TB6600驱动器驱动42步进电机(一)
- Cluster task scheduling system lsf/sge/slurm/pbs based on HPC scenario
- TypeScript 接口继承
- How much review time does it usually take to take the intermediate soft exam?
- 深入理解Apache Hudi异步索引机制
- Leetcode-303: region and retrieval - array immutable
- VR development optimization
猜你喜欢

Unable to open kernel device '\.\vmcidev\vmx': operation completed successfully. Reboot after installing vmware workstation? Module "devicepoweron" failed to start. Failed to start the virtual machine

使用Tansformer分割三维腹部多器官--UNETR实战

软考一般什么时候出成绩呢?在线蹬?

Pre knowledge reserve of TS type gymnastics to become an excellent TS gymnastics master

软考中级,软件设计师考试那些内容,考试大纲什么的?

ThreadLocal会用可不够

中级软件评测师考什么

Simple and easy to modify spring frame components

Applet jump to H5, configure business domain name experience tutorial

SQL Server knowledge gathering 9: modifying data
随机推荐
SQL Server 知识汇集11 : 约束
关于easyflash v3.3使用过程的记录
IO model review
中级网络工程师是什么?主要是考什么,有什么用?
What are the contents of the intermediate soft test, the software designer test, and the test outline?
How to prepare for the advanced soft test (network planning designer)?
优雅的 Controller 层代码
Is the soft test intermediate useful??
BUUCTF---Reverse---reverse1
VR development optimization
CSAPP bomb lab parsing
【实战】霸榜各大医学分割挑战赛的Transformer架构--nnFormer
中级软件评测师考什么
The mobile terminal automatically adjusts the page content and font size by setting rem
Schnuka: machine vision positioning technology machine vision positioning principle
使用 load_decathlon_datalist (MONAI)快速加载JSON数据
China Southern Airlines pa3.1
2021 summary and 2022 outlook
555 circuit details
Trajectory planning for multi robot systems: methods and Applications Overview reading notes