cc.Class({ extends: cc.Component, properties: { ProgressBarNode: { default: null, type: cc.Node, }, }, start () { this.SetBarLength(1); }, SetBarLength:function (BarLength) {//BarLength(0~1,float) this.ProgressBarNode.getComponent(cc.ProgressBar).progress = BarLength; } });