webui安装
方法一:在项目下面新建一个Plugins文件夹,将WebUI三个相关的包丢进去
方法二:安装到虚幻引擎中
使用
前端内嵌到视口中
设置锚点为全屏,偏移都设为0,指定一下初始访问的URL
如果是想访问文件,切换到图表如下
打开关卡蓝图
页面与UE通信
1.在index.html中添加下面代码
<script type="text/javascript">
"object"!=typeof ue||"object"!=typeof ue.interface?("object"!=typeof ue&&(ue={}),ue.interface={},ue.interface.broadcast=function(e,t){if("string"==typeof e){var o=[e,""];void 0!==t&&(o[1]=t);var n=encodeURIComponent(JSON.stringify(o));"object"==typeof history&&"function"==typeof history.pushState?(history.pushState({},"","#"+n),history.pushState({},"","#"+encodeURIComponent("[]"))):(document.location.hash=n,document.location.hash=encodeURIComponent("[]"))}}):function(e){ue.interface={},ue.interface.broadcast=function(t,o){"string"==typeof t&&(void 0!==o?e.broadcast(t,JSON.stringify(o)):e.broadcast(t,""))}}(ue.interface),(window.ue5=ue.interface.broadcast);
</script>
2.js发送到ue
前端发送
第一个参数为函数名,第二个参数为数据
ue接收
前端发送,ue相应回调函数
callbackTestCall需要与前端的对应起来
3. ue发送到js
同回调,触发事件调用Call