Version: 2017.1

UnityWebRequest.downloadProgress

切换到手册
public float downloadProgress ;

描述

返回一个 0.0 和 1.0 之间的浮点值,用于表示从服务器下载主体数据的进度。(只读)

Note: This property only works if the server’s response contains a Content-Length header and the UnityWebRequest has a DownloadHandler attached to the downloadHandler property.

如果 UnityWebRequest 完成(无论成功还是出现系统错误),此属性将始终返回 1。如果 UnityWebRequest 仍在与远程服务器进行通信,且 downloadHandlernull,此属性将返回 0.5。如果尚未调用 Send,此属性将返回 -1。