Skip to content

Commit

Permalink
修复安卓9.0中UnityWebReuquestAsync无效的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
egametang committed Apr 16, 2019
1 parent 3eacbda commit 82e0a3d
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions Unity/Assets/Model/Entity/UnityWebRequestAsync.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Threading;
using System.Threading.Tasks;
using UnityEngine;
using UnityEngine.Networking;

namespace ETModel
Expand All @@ -17,6 +14,16 @@ public override void Update(UnityWebRequestAsync self)

public class UnityWebRequestAsync : Component
{
public class AcceptAllCertificate: CertificateHandler
{
protected override bool ValidateCertificate(byte[] certificateData)
{
return true;
}
}

public static AcceptAllCertificate certificateHandler = new AcceptAllCertificate();

public UnityWebRequest Request;

public bool isCancel;
Expand Down Expand Up @@ -88,6 +95,7 @@ public ETTask DownloadAsync(string url)

url = url.Replace(" ", "%20");
this.Request = UnityWebRequest.Get(url);
this.Request.certificateHandler = certificateHandler;
this.Request.SendWebRequest();

return this.tcs.Task;
Expand Down

0 comments on commit 82e0a3d

Please sign in to comment.