当前位置:网站首页>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的方法都有所改动了,所以也要根据版本来解决这个问题。
边栏推荐
- If the value of the enum map does not exist, deserialization is not performed
- pycharm汉化教程(碧蓝幻想汉化插件安装)
- "JUC Concurrent Programming - Advanced" 06 - Immutability of Shared Models (Design of Immutable Classes | Use of Immutable Classes | Flyweight Pattern)
- 2022/7/28
- oracle优化:instr做join条件很慢「建议收藏」
- Power BI----几个常用的分析方法和相适应的视觉对象
- Experience innovation and iteration through the development of lucky draw mini-programs
- file contains vulnerabilities
- mpu9150(driverack pa简明教程)
- kubernetes之服务发现
猜你喜欢

vb.net 画曲线

After Effects 教程,如何在 After Effects 中修复曝光不足的镜头?

使用内存映射加快PyTorch数据集的读取

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

JVS函数公式使用场景介绍

Initial JDBC programming

安装MYSQL遇到问题:write configuration file卡主

一文带你了解redux的工作流程——actionreducerstore

MySql模糊查询大全

Is the working process of the belt you know the story - actionreducerstore
随机推荐
2022/7/30
After Effects 教程,如何在 After Effects 中修复曝光不足的镜头?
在 Excel 内使用 ODBC 消费 SAP ABAP CDS view
redis-enterprise use
关于Mysql数据库的介绍
MySQL 的几种碎片整理方案总结(解决delete大量数据后空间不释放的问题)
Read through the interface to call the artifact RestTemplate
502 bad gateway原因、解决方法
Android studio connects to MySQL and completes simple login and registration functions
线程池 ThreadPoolExecutor 详解
Addition logic for SAP Commerce Cloud Product Review
学习爬虫之Scrapy框架学习(1)---Scrapy框架初学习及豆瓣top250电影信息获取的实战!
vb.net 画曲线
无法将“node.exe”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。
Distributed Transactions - Introduction to Distributed Transactions, Distributed Transaction Framework Seata (AT Mode, Tcc Mode, Tcc Vs AT), Distributed Transactions - MQ
mpu9150(driverack pa简明教程)
下课看着文档走回实验室,我重新拾起了遗忘的SQL运算符
R 语言data.frame 中的另一行中减去一行
[Go Affair] See through Go's collections and slices at a glance
[Virtualization ecological platform] Raspberry Pi installation virtualization platform operation process