mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-06-26 11:24:46 +00:00
44 lines
1.1 KiB
TypeScript
44 lines
1.1 KiB
TypeScript
import { ProgressBar } from "cc";
|
|
import { _decorator } from "cc";
|
|
import { JNGLayerBase, app } from "../../App";
|
|
import { Label } from "cc";
|
|
import { GUI } from "../UIConfig";
|
|
import { API } from "../../consts/API";
|
|
import { GAction } from "../../consts/GActionEnum";
|
|
import NoviceManager from "../Novice/NoviceManager";
|
|
const { ccclass, property } = _decorator;
|
|
|
|
@ccclass('LoadingView')
|
|
export default class LoadingView extends JNGLayerBase {
|
|
|
|
@property(ProgressBar)
|
|
progress:ProgressBar;
|
|
|
|
@property(Label)
|
|
label:Label;
|
|
|
|
//是否加载成功
|
|
isOk:boolean = false;
|
|
|
|
update(dt:number){
|
|
if(app.loading.getCurrentInfo())
|
|
this.label.string = app.loading.getCurrentInfo().title;
|
|
this.progress.progress = app.loading.progress();
|
|
if(!this.isOk && app.loading.isAllSuccess()){
|
|
this.isOk = true;
|
|
this.onSuccess();
|
|
}
|
|
}
|
|
|
|
async onSuccess(){
|
|
|
|
await NoviceManager.getIns().onStart();
|
|
|
|
//关闭加载页
|
|
await app.layer.Open(GUI.Main);
|
|
app.layer.Close(GUI.Loading);
|
|
|
|
}
|
|
|
|
}
|