赞
踩
原因:
数据请求提交过程中,UnityWebRequest 不时出现数据没有释放的情况,偶尔会一部分数据
内存溢出情况:
解决方法:
UnityWebRequest 前加上using
- IEnumerator Post(callBack call)
- {
- WWWForm form = new WWWForm();
- form.AddField("name", "myData");
- form.AddField("id", "myData");
- form.AddField("message", "myData");
-
- using UnityWebRequest www = UnityWebRequest.Post(HttpConfig.goServer_url+postUrl, form);
- yield return www.SendWebRequest();
-
- if (www.result != UnityWebRequest.Result.Success)
- {
- Debug.Log(www.error);
- }
- else
- {
- Debug.Log("Form upload complete!");
- Debug.Log(www.downloadHandler.text);
- }
- }
原因:
许可证问题。
解决方法:
unity hub登出。
原因:项目设置中项目名称包含空格。
解决方法:将空格删掉。
A re-import of the project may be required to fix the issue or a manual modification of D:/Work/20230110_zhangpeng/gitee/ZhangGu_3D-main-1/ZhangGu_3D-main/Packages/manifest.json file.
解决方法:
将Packages/manifest.json,删除重新加载。
开发webgl的项目,在编译器里用get和post请求没问题,但是打包出来以后就出现问题了。
from origin 'file://' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
这种错误就是出现了跨域问题。一般这种问题我们都是交给写后端接口的同事来处理。
当然我们也有另外的处理方法,就是设置谷歌浏览器(chrome)允许跨域。
直接创建chrome浏览器的快捷方式,在属性中找到打开路径,在…chrome.exe后面加上
--args --disable-web-security --user-data-dir="C:/ChromeDevSession"
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。