@zhb196341 写道:
Creator中removeChildByTag方法只会一次删除一个节点吗,我用这个方法每次只删除一个节点,是不是必须要用removeAllChildren
onTouchAction: function (event) {
if (event.type == cc.Node.EventType.TOUCH_END) {
var nd = event.target;
if (nd.name == "Button_exit") {
nd.parent.getChildByName("bg").removeAllChildren();
nd.parent.removeChildByTag(1);
//nd.parent.active=false;
}
if (nd.tag == 1) {
var paras = { type: comMsg.ROOM_CHOOSE, opsel: nd.name };
socketPack.sendData(paras);
var opMenu = this.plMenu.getChildByName("opMenu");
if (opMenu != null) {
opMenu.removeAllChildren();
}
nd.parent.removeChildByTag(1);
nd.parent.active=false;
}
}
},
帖子: 1
参与者: 1