cocos-vuecli-demo/cocosTem/assets/Script/emitNode.js

21 lines
409 B
JavaScript
Raw Permalink Normal View History

2021-04-09 06:43:19 +00:00
cc.Class({
extends: cc.Component,
properties: {
},
onLoad: function () {
this.node.on(
cc.Node.EventType.TOUCH_END,
e => {
e.stopPropagation();
if (window.eventBus) {
window.eventBus.emit('WEB_MSG_TYPE.SELECT_NODE', e.currentTarget);
}
},
this
);
},
});