Quantcast
Channel: Cocos中文社区 - 最新主题
Viewing all articles
Browse latest Browse all 88737

removeChildByTag方法只会一次删除一个节点

$
0
0

@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

阅读整个主题


Viewing all articles
Browse latest Browse all 88737

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>