当前位置:网站首页>WebGL给Unity传递参数问题1: Cannot read properties of undefined (reading ‘SendMessage‘)
WebGL给Unity传递参数问题1: Cannot read properties of undefined (reading ‘SendMessage‘)
2022-07-31 11:43:00 【先生沉默先】
Cannot read properties of undefined (reading ‘SendMessage’)
报错信息翻译:无法读取未定义的属性(读取“SendMessage”)
问题:WebGL给Unity传递参数并调用方法,在浏览器报错。


解决方式
缺少一个全局变量,并且没有把创建的全局变量在回调中用unityInstance赋值?这里报错的意思是,你用的“SendMessage”是未定义的,为什么会未被定义呢?是因为你的unityInsace是空的,所以他说你的“SendMessage”的未被定义的。具体步骤是在这篇博客的
https://blog.csdn.net/GoodCooking/article/details/123590928

问题来自
用户的私信。报错的Unity版本为2020.3,
因为Unity更新之后,在WEBGL调用Unity方法和Unity调用WebGL的方法都有所改动了,所以也要根据版本来解决这个问题。
边栏推荐
- 基于Multisim的函数信号发生器–方波、三角波、正弦波[通俗易懂]
- 《MySQL高级篇》五、InnoDB数据存储结构
- R语言:文本(字符串)处理与正则表达式
- In PLC communication error or timeout or download the prompt solution of the model
- Unix知识:shell详细解读
- 3.网页信息解析方法:Xpath与BeautifulSoup
- 关于Mysql数据库的介绍
- [Go Affair] See through Go's collections and slices at a glance
- 初始JDBC 编程
- 学习爬虫之Scrapy框架学习(1)---Scrapy框架初学习及豆瓣top250电影信息获取的实战!
猜你喜欢

Service discovery of kubernetes

Master SSR

2022/7/28

If the value of the enum map does not exist, deserialization is not performed

Redis学习笔记-3.慢查询和其他高级数据结构

三六零与公安部三所发布报告:关基设施保护成为网络安全博弈关键

JVS函数公式使用场景介绍

透过开发抽奖小程序,体会创新与迭代

ApiPost is really fragrant and powerful, it's time to throw away Postman and Swagger

订song餐系统
随机推荐
一文吃透接口调用神器RestTemplate
关于Mysql数据库的介绍
分布式id解决方案
oracle优化:instr做join条件很慢「建议收藏」
便利贴--46{基于移动端长页中分页加载逻辑封装}
第十二章 使用中的 OpenAPI 属性
瑞吉外卖项目:新增菜品与菜品分页查询
apisix-入门使用篇
2022/7/28
Life is endless, there are more questions, simple questions to learn knowledge points
file contains vulnerabilities
淀粉与纤维素
蓝牙协议栈开发板 STM32F1 跑蓝牙协议栈 –传统蓝牙搜索演示以及实现原理[通俗易懂]
apisix-Getting Started
Docker实践经验:Docker 上部署 mysql8 主从复制
LeetCode 1161.最大层内元素和:层序遍历
DCM middleware family welcomes a new member
Data Lake (19): SQL API reads Kafka data and writes it to Iceberg table in real time
[Go Affair] See through Go's collections and slices at a glance
Cloudera Manager —— 端到端的企业数据中心管理工具