properties: {
btn:cc.Button,
index :0,
},
// LIFE-CYCLE CALLBACKS:
onLoad () {
this.btn.node.on("click",this.onbtnClick,this);
this.btn.node.on("click",this.onbtnClick,this);
this.btn.node.on("click",this.onbtnClick,this);
},
start () {
},
onbtnClick()
{
this.index ++ ;
console.log(this.index);
},
上面这段代码点击按钮index会不会增加和输出三次