当前位置:网站首页>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);
}
边栏推荐
- How to play video on unityui
- 路由器开发知识汇总
- 2022年7月10日“五心公益”活动通知+报名入口(二维码)
- 【安装系统】U盘安装系统教程,使用UltraISO制作U盘启动盘
- Using U2 net deep network to realize -- certificate photo generation program
- 多线程-异步编排
- ThreadLocal is not enough
- [detailed explanation of Huawei machine test] tall and short people queue up
- [homework] 2022.7.6 write your own cal function
- 无法打开内核设备“\\.\VMCIDev\VMX”: 操作成功完成。是否在安装 VMware Workstation 后重新引导? 模块“DevicePowerOn”启动失败。 未能启动虚拟机。
猜你喜欢
Basic introduction of yarn and job submission process
如何顺利通过下半年的高级系统架构设计师?
Using tansformer to segment three-dimensional abdominal multiple organs -- actual battle of unetr
Différences entre les contraintes monotones et anti - monotones
简单易修改的弹框组件
Mendeley--免费的文献管理工具,给论文自动插入参考文献
China Southern Airlines pa3.1
【STM32】实战3.1—用STM32与TB6600驱动器驱动42步进电机(一)
[recommendation system 01] rechub
"Dream Cup" 2017 Jiangsu information and future primary school summer camp it expert PK program design questions
随机推荐
Typescript interface inheritance
What are the test preparation materials and methods for soft exam information processing technicians?
Mendeley -- a free document management tool that automatically inserts references into papers
想考中级软考,一般需要多少复习时间?
ThreadLocal is not enough
SQL Server 知识汇集11 : 约束
无法打开内核设备“\\.\VMCIDev\VMX”: 操作成功完成。是否在安装 VMware Workstation 后重新引导? 模块“DevicePowerOn”启动失败。 未能启动虚拟机。
CAS机制
Différences entre les contraintes monotones et anti - monotones
使用U2-Net深层网络实现——证件照生成程序
ThreadLocal会用可不够
[homework] 2022.7.6 write your own cal function
Is the soft test intermediate useful??
Using tansformer to segment three-dimensional abdominal multiple organs -- actual battle of unetr
中级软件评测师考什么
【推荐系统 02】DeepFM、YoutubeDNN、DSSM、MMOE
gym安装踩坑记录
Schnuka: machine vision positioning technology machine vision positioning principle
长列表性能优化方案 memo
TypeScript 接口继承