|
|
@@ -9,7 +9,7 @@ export class FarmCountDown extends cc.Component {
|
|
|
@property({ type: cc.Component.EventHandler, tooltip: "生虫回调" }) onSick: cc.Component.EventHandler = null;
|
|
|
@property({ type: cc.Component.EventHandler, tooltip: "加速按钮回调" }) onSpeedButton: cc.Component.EventHandler = null;
|
|
|
@property({ type: cc.Node, tooltip: "常驻计时器组" }) normalGroup: cc.Node = null;
|
|
|
- @property({ type: cc.ProgressBar, tooltip: "常驻进度条" }) normalProgress: cc.ProgressBar = null;
|
|
|
+ @property({ type: cc.Sprite, tooltip: "常驻进度条" }) normalProgress: cc.Sprite = null;
|
|
|
@property({ type: BitmapFontC, tooltip: "常驻计时" }) normalCount: BitmapFontC = null;
|
|
|
@property({ type: cc.Node, tooltip: "可收获图标" }) ripedIcon: cc.Node = null;
|
|
|
@property({ type: cc.Node, tooltip: "生病图标" }) sickIcon: cc.Node = null;
|
|
|
@@ -32,7 +32,7 @@ export class FarmCountDown extends cc.Component {
|
|
|
this.sickIcon.active = false;
|
|
|
this.counting = true;
|
|
|
this.normalCount.string = '';
|
|
|
- this.normalProgress.progress = 0;
|
|
|
+ this.normalProgress.fillRange = 0;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -41,7 +41,7 @@ export class FarmCountDown extends cc.Component {
|
|
|
if (this.counting && now < this.ripeTime) {
|
|
|
let timeString = Util.ParseTime2Format(Math.floor((this.ripeTime - now) * 0.001), 'm:s');
|
|
|
this.normalCount.string = timeString;
|
|
|
- this.normalProgress.progress = 1 - ((this.ripeTime - now) / (this.totleTime * 1000));
|
|
|
+ this.normalProgress.fillRange = 1 - ((this.ripeTime - now) / (this.totleTime * 1000));
|
|
|
} else if (this.counting && now > this.ripeTime) {
|
|
|
if (!this.isRipeInit) {
|
|
|
this.isRipeInit = true;
|
|
|
@@ -77,8 +77,9 @@ export class FarmCountDown extends cc.Component {
|
|
|
* @param state 0 生虫 1 成熟
|
|
|
*/
|
|
|
setState(state) {
|
|
|
- this.normalProgress.progress = 0;
|
|
|
+ this.normalProgress.fillRange = 0;
|
|
|
this.normalCount.string = '';
|
|
|
+ this.normalGroup.active = false;
|
|
|
if (state == 0) {
|
|
|
this.sickIcon.active = true;
|
|
|
this.ripedIcon.active = false;
|