void WWWPath(WebUrl)
{
if (WebUrl.Substring(0, 5) == "https")
{
// 解决WebClient不能通过https下载内容问题
System.Net.ServicePointManager.ServerCertificateValidationCallback +=
delegate (object sender, System.Security.Cryptography.X509Certificates.X509Certificate certificate,
System.Security.Cryptography.X509Certificates.X509Chain chain,
System.Net.Security.SslPolicyErrors sslPolicyErrors)
{
return true; //
}
}
CheckExtractResource(); //释放资源
}
public void CheckExtractResource(){StartCoroutine(OnExtractResource(infile)); //启动释放协成 }
IEnumerator OnExtractResource(string infile)
{
WWW www = new WWW(infile);
yield return www;
if (www.isDone)
{
File.WriteAllBytes(outfile, www.bytes);
}
yield return 0;
}