我正在尝试创建一个API的unityWebRequest,并且一切都在一个普通的unity应用程序上顺利运行,但是当我将应用程序转移到我的oculus quest时,"checkCode()“方法一被调用就触发了执行unityWebRequest的GetAuthRequest()方法,oculus应用程序就崩溃了。
我尝试过用几种不同的方式重写代码,但似乎都没有解决这个问题。我的任务有互联网接入,我相信我已经安装了Android SDK。
public void CheckCode()
{
StartCoroutine(GetAuthRequest("http://myURL/", attemptedCode));
}
IEnumerator GetAuthRequest(string uri, string attemptedCode)
{
setValue("IN_REQ");
using (UnityWebRequest webRequest = UnityWebRequest.Get(uri + attemptedCode))
{
//// Request and wait for the desired page.
yield return webRequest.SendWebRequest();
if (webRequest.isNetworkError)
{
setValue("NET_ERROR");
}
else
{
if (webRequest.downloadHandler.text.Equals("true"))
{
ClearCode();
setValue("Authenticated!");
}
else
{
ClearCode();
setValue("Error...");
}
}
}
}发布于 2020-02-26 01:56:22
试着用"https://myURL/“代替"http://myURL/”
https://stackoverflow.com/questions/56991667
复制相似问题