零基础网站建设视频教程,怎么做视频网站,杭州高端网站制作,分类信息网站有哪些参考博客#xff1a;
http://t.csdnimg.cn/QnfhK
问题背景#xff1a;
需要在外面的网页指定WebGL的打开初始化逻辑。
步骤#xff1a;
1.配置jslib#xff0c;用文本文件创建即可#xff0c;__Internal.jslib。 2.加入一段代码#xff1a;
mergeInto(…参考博客
http://t.csdnimg.cn/QnfhK
问题背景
需要在外面的网页指定WebGL的打开初始化逻辑。
步骤
1.配置jslib用文本文件创建即可__Internal.jslib。 2.加入一段代码
mergeInto(LibraryManager.library,
{ StringReturnValueFunction: function(){var returnStr window.location.search;var buffer _malloc(lengthBytesUTF8(returnStr) 1);writeStringToMemory(returnStr, buffer);return buffer;},
});
3.场景挂一个脚本引用这个代码。
using System.Collections;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using UnityEngine;public class TestURLPara : MonoBehaviour
{[DllImport(__Internal)]private static extern string StringReturnValueFunction();public static string UrlMsg string.Empty;public UnityEngine.UI.Text Text;void Start(){UrlMsg 空;try{UrlMsg StringReturnValueFunction();}catch (System.Exception e){UrlMsg [catch]e.Message;}Text.text UrlMsg;}void Update(){}
}
4.url中末尾用?输入需要传输的内容能够传递。