[LayaAir3]layaair3.1 on()方法错误
问题代码:
onEnable(): void {
this.StartBox.on(Laya.Event.CLICK, this, () => {
//点击后,打开UI场景示例
console.log("开始游戏");
});
}
错误代码
TypeError: Cannot read properties of undefined (reading 'on')
跟着示例写的,但是运行会出错,编辑器没提示错误。
onEnable(): void {
this.StartBox.on(Laya.Event.CLICK, this, () => {
//点击后,打开UI场景示例
console.log("开始游戏");
});
}
错误代码
TypeError: Cannot read properties of undefined (reading 'on')
跟着示例写的,但是运行会出错,编辑器没提示错误。
没有找到相关结果
已邀请:
要回复问题请先登录
1 个回复
Laya_Fred
赞同来自: