接着问问题~

想要实现的功能:
第二次触摸会把第一次触摸时生成的NewNote销毁后再生成新的NewNote

但是现在完全不生成NewNote

代码如下

cc.Class({
extends: cc.Component,

properties: {
	NewNotePrefab:{
		default:null,
		type:cc.Prefab
	},
	bar0:{
		default:null,
		type:cc.Node
	},
	bar1:{
		default:null,
		type:cc.Node
	},
},

setNoteFunction:function(){
	//把this.bar0给setNoteFunctionsub的targetbar
	this.setNoteFunctionsub(this.bar0);
    this.setNoteFunctionsub(this.bar1);
},

setNoteFunctionsub:function(targetbar){
    targetbar.on("touchstart",function(){
    	cc.NewNote.destory();
		var NewNote = cc.instantiate(this.NewNotePrefab);
		NewNote.parent = targetbar;
		NewNote.setPosition(0,0);
	},this);
},

onLoad () {
	cc.repeatForever(this.setNoteFunction());
},

start () {

},

});