一 UE4中开启Web UI插件
二
1. 创建.html文件
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>test</title>
</head>
<body>
<button onclick = "bindTest()"> 绑定测试 </button>
<button onclick = "callUE4Func()"> callUE4Func </button>
<script>
// create the global ue4(...) helper function
// 帮助函数
"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.

本文介绍了如何在UE4中启用WebUI插件,并通过创建.html文件和蓝图设置UMG组件,实现JavaScript与UE4之间的函数调用。通过示例代码展示了JS如何绑定测试函数和调用UE4的函数,以及UE4如何反向调用JavaScript函数。该教程适合希望在UE4中利用HTML进行UI开发的开发者。
最低0.47元/天 解锁文章
4868

被折叠的 条评论
为什么被折叠?



