当前位置: 首页 > article >正文

WEBUI插件和UE5通讯

UE5发送数据

在这里插入图片描述
js代码中接收内容

  ue.interface.UESetData = function (ueData) {    
		//ueData为UE5中具体的内容
        };

JS发送内容给UE

js代码中添加此段内容

 <script type="text/javascript">
        // create the global ue5(...) helper function
        "object" != typeof ue && (ue = {}), uuidv4 = function () { return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, function (t) { return (t ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> t / 4).toString(16) }) }, ue5 = function (r) { return "object" != typeof ue.interface || "function" != typeof ue.interface.broadcast ? (ue.interface = {}, function (t, e, n, o) { var u, i; "string" == typeof t && ("function" == typeof e && (o = n, n = e, e = null), u = [t, "", r(n, o)], void 0 !== e && (u[1] = e), i = encodeURIComponent(JSON.stringify(u)), "object" == typeof history && "function" == typeof history.pushState ? (history.pushState({}, "", "#" + i), history.pushState({}, "", "#" + encodeURIComponent("[]"))) : (document.location.hash = i, document.location.hash = encodeURIComponent("[]"))) }) : (i = ue.interface, ue.interface = {}, function (t, e, n, o) { var u; "string" == typeof t && ("function" == typeof e && (o = n, n = e, e = null), u = r(n, o), void 0 !== e ? i.broadcast(t, JSON.stringify(e), u) : i.broadcast(t, "", u)) }); var i }(function (t, e) { if ("function" != typeof t) return ""; var n = uuidv4(); return ue.interface[n] = t, setTimeout(function () { delete ue.interface[n] }, 1e3 * Math.max(1, parseInt(e) || 0)), n });
    </script>

把要发的东西输入(在主要的script中)

  ue5("发送消息");

http://www.kler.cn/a/596474.html

相关文章:

  • 爬虫——playwright获取亚马逊数据
  • 2025年3月AI搜索发展动态与趋势分析:从技术革新到生态重构
  • 清洁机器人垃圾物识别与智能分类回收系统研究(大纲)
  • 【 <二> 丹方改良:Spring 时代的 JavaWeb】之 Spring Boot 中的 RESTful API 设计:从上手到骨折
  • MyBatis 中 #{} 和 ${} 的区别详解
  • [思考记录]两则:宏观视角、理想化
  • 高等数学-第七版-上册 选做记录 习题5-2
  • 手机怎么换网络IP有什么用?操作指南与场景应用‌
  • MySQL高频八股——索引
  • Cables Finance 即将发布新的积分奖励计划及代币空投
  • 项目日记 -云备份 -服务器配置信息模块
  • Kafka consumer_offsets 主题深度剖析
  • SSE详解面试常考问题详解
  • HTTP 失败重试(重发)方案
  • PHP 应用留言板功能超全局变量数据库操作第三方插件引用
  • PRODIGY: “不折腾人”的蛋白-蛋白/蛋白-小分子结合能计算工具
  • 多线程14(哈希表与文件操作IO)
  • 数据结构(排序(上)):冒泡、选择、插入
  • Vue.js 模板语法全解析:从基础到实战应用
  • Java8 流式分组(groupingBy)与分区(partitioningBy)深度解析