第一次接触Cocsos Creator ,用Unity习惯了,有点不习惯,记录学习的成果而已。
cc.Class({
extends: cc.Component,
properties: {
score_lab: cc.Node,
time_lab:cc.Label,
},
// LIFE-CYCLE CALLBACKS:
// onLoad () {},
start () {
this.scoreLab = this.score_lab.getComponent(cc.Label);
this.score = 0;
},
update (dt) {},
test_Btn(){
this.score += 1;
this.scoreLab.string = this.score.toString();
this.time_lab.string=this.score;
},
});