免费网站管理软件,个人网站前置审批项,芝麻开门网站建设,旅行社网站设计方案需求#xff1a;
WebGL跳转网址
现象:
Application.OpenURL(https://www.baidu.com);
这个函数在安卓上可以用#xff0c;IOS 不管用
解决方案:
编写js插件#xff0c;unity调用js函数#xff0c;由js跳转网址
注意事项 #xff1a;
插件后缀为.jsli…需求
WebGL跳转网址
现象:
Application.OpenURL(https://www.baidu.com);
这个函数在安卓上可以用IOS 不管用
解决方案:
编写js插件unity调用js函数由js跳转网址
注意事项
插件后缀为.jslib 并且放到Unity工程Plugins文件夹下
C#代码加上[DllImport] public void OpenURL(){JSOpenURL();}[DllImport(__Internal)]public static extern void JSOpenURL();
mergeInto(LibraryManager.library, {JSOpenURL: function () {//window.open(https://www.baidu.com);location.href https://www.baidu.com;},HelloString: function (str) {window.alert(Pointer_stringify(str));},PrintFloatArray: function (array, size) {for(var i 0; i size; i)console.log(HEAPF32[(array 2) i]);},AddNumbers: function (x, y) {return x y;},StringReturnValueFunction: function () {var returnStr bla;var bufferSize lengthBytesUTF8(returnStr) 1;var buffer _malloc(bufferSize);stringToUTF8(returnStr, buffer, bufferSize);return buffer;},BindWebGLTexture: function (texture) {GLctx.bindTexture(GLctx.TEXTURE_2D, GL.textures[texture]);},});
高级跳转功能:
如跳转各大应用商店唤醒APP等暂时不写催我就写哈哈
IOSAppStore:
itms-apps://itunes.apple.com/us/developer/short name/idyour developer id 帮助链接:
官方文档
https://docs.unity3d.com/2021.1/Documentation/Manual/webgl-interactingwithbrowserscripting.html
JS页面跳转常用函数
https://share.ciyuanpi.cn/UnityWebGL/index.html?nicknamejiangbourlavatarAssetNamewukong_t-poseismanghetrue