报错堆栈:
初步定位cocos2d-jsb.js第15828行的this.node.emit(“click”, this);,点击事件时,this.node已经是null
位于cc.Button的函数_onTouchEnded内
_onTouchEnded: function(t) {
if (this.interactable && this.enabledInHierarchy) {
if (this._pressed) {
cc.Component.EventHandler.emitEvents(this.clickEvents, t);
this.node.emit(“click”, this);
}
this._pressed = !1;
this._updateState();
t.stopPropagation();
}
},
项目所有cc.Button的点击事件都是靠编辑器拖拽绑定,没有代码写的,引擎对this.node的生命周期管理和事件响应是否有BUG?
翻翻源码,看看是不是有些时候没off事件。
麻烦审题,编辑器拖拽的事件怎么off
所以让你翻翻引擎源码啊
