通过下载文件UnityEngine.WWW,我收到错误
OverflowException:Number溢出.
我发现错误是由结构本身引起的,因为字节数组比int.MaxValue可以分配更多的字节(~2GB).
通过返回数组来触发错误www.bytes,这意味着框架可能以其他方式存储数组.
如何以其他方式访问下载的数据,还是有更大的文件替代?
public IEnumerator downloadFile()
{
WWW www = new WWW(filesource);
while(!www.isDone)
{
progress = www.progress;
yield return null;
}
if(string.IsNullOrEmpty(www.error))
{
data = www.bytes; // <- Errormessage fired here
}
}
Run Code Online (Sandbox Code Playgroud)