Creator 版本:1.9.1
目标平台:wechat
重现方式:
//生成多个障碍物
//如果上一个障碍物运行到一定位置就再次生成,玩家的高度+玩家高度*随机数 作为再次生成的节点
setNewDangluMore(){
var children = this.node.children
var lastDangluNodeY = children[children.length-1].getPositionY();
var cheHeight = this.cheqi.getContentSize().height;
var randY = cheHeight+cc.random0To1()*cheHeight*0.1;
if(lastDangluNodeY < randY){
this.spawnNewDanglu();
}
},
removeAllremoveAllListeners(){
this.node.stopAllActions();
console.log('ppppppppppppppppppppppp');
},
详细描述:stopAllAction 会停止后续的节点生成,已经生成的节点以及该节点上的adction 会继续执行。


