unity webgl 移动端 去掉提示框
在完成 Unity 打包 WebGL 工程之后, 将整个项目放到 阿里云的服务器上, 就可以通过地址访问了.
问题:
在手机上打开连接时, 每次都会弹出提示框: Please note that Unity WebGL is not currently supported on mobiles. Press OK if you wish to continue anyway.
然后最下面有个 OK
按钮. 而当我不需要这个提示框时, 该如何取消它的显示呢?
解决方法
修改UnityLoader.js文件:
compatibilityCheck:function(e,t,r){
UnityLoader.SystemInfo.hasWebGL?
UnityLoader.SystemInfo.mobile?
t()
:["Firefox","Chrome","Safari"].indexOf(UnityLoader.SystemInfo.browser)==-1?
t()
:t()
:e.popup("Your browser does not support WebGL",[{text:"OK",callback:r}])
},
// compatibilityCheck:function(e,t,r){
// UnityLoader.SystemInfo.hasWebGL?
// UnityLoader.SystemInfo.mobile?
// e.popup("Please note that Unity WebGL is not currently supported on mobiles. Press OK if you wish to continue anyway.",[{text:"OK",callback:t}])
// :["Firefox","Chrome","Safari"].indexOf(UnityLoader.SystemInfo.browser)==-1?
// e.popup("Please note that your browser is not currently supported for this Unity WebGL content. Press OK if you wish to continue anyway.",[{text:"OK",callback:t}])
// :t()
// :e.popup("Your browser does not support WebGL",[{text:"OK",callback:r}])
// },
Blobs:{},loa...(省略)