cc.Class({
extends: cc.Component,
properties: {
progressBar: {
default:null,
type:cc.ProgressBar
},
},
// use this for initialization
onLoad: function () {
this.progressBar.progress=0.01
},
// called every frame, uncomment this function to activate update callback
update: function (dt) {
var progress = this.progressBar.progress;
if (progress > 0) {
progress += 0.01;
}
else {
progress = 1;
}
this.progressBar.progress = progress;
},
});