今天是想把前两天写的Demo拿到Mac上打个IPA的完事我发现 在运行时释放游戏资源的时候UnityWebRequest返回的结果不是Success 查看Log发现是 req.result 是CommectionError error是 Cannot connect to destination host
代码如下:
UnityWebRequest req = UnityWebRequest.Get(infile);
yield return req.SendWebRequest();
if (req.result != UnityWebRequest.Result.Success)
{
Debug.LogError(req.result + " " + req.error + " path:" + infile);
yield break;
}
解决方案:
给你的Path加上"file://" 即可