import { BaseView } from "../../../lightMVC/core/base/BaseView"; import { App } from "../../Manager/App"; import { Sex } from "../../Framework/Const/EnumDefine"; import NotifyModel from "../../model/NotifyModel"; import hallModel from "../../model/hallModel"; import player from "../../player"; const { ccclass, property } = cc._decorator; @ccclass export default class SmallPanel extends BaseView { private progressBar: cc.ProgressBar = null; private currentTime: number = 0; public drawView(): void { console.log('SmallPanel~~~~~~~~~~'); let progress = this.ui.getNode("progress"); this.progressBar = progress.getComponent(cc.ProgressBar); this.currentTime = App.DataManager.SmallTime; let label = this.ui.getNode("label"); let action = cc.sequence(cc.scaleTo(0.5, 1.2), cc.scaleTo(0.5, 1)); action.repeatForever(); label.runAction(action); } update(dt) { if (!this.progressBar || this.currentTime <= 0) return; this.currentTime -= dt; let progress = this.currentTime / App.DataManager.SmallTime; this.progressBar.progress = (progress < 0) ? 0 : progress; if (progress <= 0) { player.getInstance().SetSmallBack(); this.closeView(); } } public static path(): string { return "prefabs/SmallPanel"; } }