当前位置:网站首页>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的方法都有所改动了,所以也要根据版本来解决这个问题。
边栏推荐
- The most complete phpmyadmin vulnerability summary
- 透过开发抽奖小程序,体会创新与迭代
- 下课看着文档走回实验室,我重新拾起了遗忘的SQL运算符
- 【软件工程之美 - 专栏笔记】33 | 测试工具:为什么不应该通过QQ/微信/邮件报Bug?
- 5 个开源的 Rust Web 开发框架,你选择哪个?
- In PLC communication error or timeout or download the prompt solution of the model
- 音视频基础
- 才22岁!这位'00后'博士拟任职985高校!
- 一周精彩内容分享(第14期)
- 最新MySql安装教学,非常详细
猜你喜欢

准确率(Accuracy)、精度(Precision)、召回率(Recall)和 mAP 的图解

Initial JDBC programming

多线程学习笔记-2.final关键字和不变性

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

Mysql环境变量的配置(详细图解)
502 bad gateway原因、解决方法

《MySQL高级篇》四、索引的存储结构

“带薪划水”偷刷阿里老哥的面经宝典,三次挑战字节,终成正果

Distributed Transactions - Introduction to Distributed Transactions, Distributed Transaction Framework Seata (AT Mode, Tcc Mode, Tcc Vs AT), Distributed Transactions - MQ

apisix-Getting Started
随机推荐
若枚举映射的值不存在,则不进行反序列化
Curl 命令使用
The latest MySql installation teaching, very detailed
deeplab implements its own remote sensing geological segmentation dataset
安装MYSQL遇到问题:write configuration file卡主
ESP8266-Arduino编程实例-PIR(被动红外)传感器驱动
第十二章 使用中的 OpenAPI 属性
Use Excel to read data exposed by SAP ABAP CDS View through ODBC
vb.net 画曲线
mysql automatically adds creation time and update time
JVS函数公式使用场景介绍
关于IDEA开发工具的介绍
矩形脉冲波形的占空比及脉冲和瞬态特征的测量
deeplab实现自己遥感地质分割数据集
使用内存映射加快PyTorch数据集的读取
便利贴--46{基于移动端长页中分页加载逻辑封装}
Docker搭建Mysql主从复制
xmind使用指南(XMind具有下列哪些功能)
pycharm汉化教程(碧蓝幻想汉化插件安装)
Experience innovation and iteration through the development of lucky draw mini-programs