例如将button挂载到脚本上,然后使用this.button.on(‘mousedown’,function (event) {
console.log(‘Mouse down’);
}, this)


例如将button挂载到脚本上,然后使用this.button.on(‘mousedown’,function (event) {
console.log(‘Mouse down’);
}, this)


阿姨都来抢饭碗了
this.button.node.on()
事件的发起者是节点, 你在场景里创建的是一个带有Button组件的节点.
Creator编辑器拖动节点到脚本的Button属性, 是编辑器自动把节点的组件绑定到脚本属性. 表面上你操作的是节点, 实际上绑定的是组件.
贫穷
谢谢