当前位置:网站首页>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);
}
边栏推荐
- 【安装系统】U盘安装系统教程,使用UltraISO制作U盘启动盘
- Leetcode-303: region and retrieval - array immutable
- The mobile terminal automatically adjusts the page content and font size by setting rem
- 使用U2-Net深层网络实现——证件照生成程序
- leetcode-560:和为 K 的子数组
- China Southern Airlines pa3.1
- 在线硬核工具
- leetcode-304:二维区域和检索 - 矩阵不可变
- openinstall与虎扑达成合作,挖掘体育文化产业数据价值
- 想考中级软考,一般需要多少复习时间?
猜你喜欢
软考中级,软件设计师考试那些内容,考试大纲什么的?
软考一般什么时候出成绩呢?在线蹬?
Using tansformer to segment three-dimensional abdominal multiple organs -- actual battle of unetr
南航 PA3.1
Multithreaded asynchronous orchestration
China Southern Airlines pa3.1
[STM32] solution to the problem that SWD cannot recognize devices after STM32 burning program
2022年7月10日“五心公益”活动通知+报名入口(二维码)
Cluster task scheduling system lsf/sge/slurm/pbs based on HPC scenario
简单易修改的弹框组件
随机推荐
JS实现链式调用
【STM32】实战3.1—用STM32与TB6600驱动器驱动42步进电机(一)
那些易混淆的概念(三):function和class
TypeScript 接口继承
Schnuka: machine vision positioning technology machine vision positioning principle
Common shortcut keys in IDA
Jump to the mobile terminal page or PC terminal page according to the device information
BUUCTF---Reverse---reverse1
Long list performance optimization scheme memo
使用Tansformer分割三维腹部多器官--UNETR实战
Installation and configuration of slurm resource management and job scheduling system
香橙派OrangePi 4 LTS开发板通过Mini PCIE连接SATA硬盘的操作方法
Using tansformer to segment three-dimensional abdominal multiple organs -- actual battle of unetr
Leetcode-303: region and retrieval - array immutable
1321: [example 6.3] deletion problem (noip1994)
單調性約束與反單調性約束的區別 monotonicity and anti-monotonicity constraint
Openinstall and Hupu have reached a cooperation to mine the data value of sports culture industry
[système recommandé 01] rechub
Trajectory planning for multi robot systems: methods and Applications Overview reading notes
Leetcode-304: two dimensional area and retrieval - matrix immutable