在导入Steam VR 插件后报错:
InvalidOperationException: Insecure connection not allowed
UnityEngine.Networking.UnityWebRequest.SendWebRequest () (at <4139bb31c03640e7b650db6ec39d5754>:0)
UnityEngine.WWW..ctor (System.String url) (at <384e0fe1666848ef9ddc0b495902df33>:0)
Valve.VR.SteamVR_Update.Update () (at Assets/SteamVR/Editor/SteamVR_Update.cs:42)
UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at <7b4f3dc961684c98b64a8a94a10cd68d>:0)
该错误是由于新版本的Unity默认是不允许HTTP请求的
点击Edit->Project Settings…,选中Player,在Other Settings中找到Allow downloads over HTTP*,修改其访问权限为Always allowed即可。
选择Always allowed,会弹出一个警告:
?Plain text HTTP connections are not secure and can make your application vulnerable to attacks.?
(释义:纯文本HTTP连接不安全,可能会使您的应用程序容易受到攻击。)
备注:如果你是用的接口地址使用的都是Https,建议选择第二个,仅仅在开发环境使用http。如果你的接口地址存在Http协议,建议选择Always allowed,否则在发布后,接口可能会不通。