|
@@ -1,5 +1,4 @@
|
|
-import { _decorator,Component,director,Label, ProgressBar } from 'cc';
|
|
|
|
-import { UIBase } from '../GameFrameWork/UIBase';
|
|
|
|
|
|
+import { _decorator, Component, Label, ProgressBar } from 'cc';
|
|
const { ccclass, property } = _decorator;
|
|
const { ccclass, property } = _decorator;
|
|
|
|
|
|
@ccclass('LoadingUI')
|
|
@ccclass('LoadingUI')
|
|
@@ -35,16 +34,16 @@ export class LoadingUI extends Component {
|
|
this.progressLabel = this.getComponentInChildren(Label);
|
|
this.progressLabel = this.getComponentInChildren(Label);
|
|
this.whichRes = this.node.getChildByName("_which").getComponent(Label);
|
|
this.whichRes = this.node.getChildByName("_which").getComponent(Label);
|
|
}
|
|
}
|
|
- public updateProgress(progress: number){
|
|
|
|
- if(this.progressBar){
|
|
|
|
|
|
+ public updateProgress(progress: number) {
|
|
|
|
+ if (this.progressBar) {
|
|
this.progressBar.progress = progress;
|
|
this.progressBar.progress = progress;
|
|
}
|
|
}
|
|
- if(this.progressLabel){
|
|
|
|
|
|
+ if (this.progressLabel) {
|
|
this.progressLabel.string = `${Math.floor(progress * 100)}%`;
|
|
this.progressLabel.string = `${Math.floor(progress * 100)}%`;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- public updateWhichRes(which: number){
|
|
|
|
- if(this.whichRes){
|
|
|
|
|
|
+ public updateWhichRes(which: number) {
|
|
|
|
+ if (this.whichRes) {
|
|
this.whichRes.string = `${which}/3`;
|
|
this.whichRes.string = `${which}/3`;
|
|
}
|
|
}
|
|
}
|
|
}
|