This commit is contained in:
DESKTOP-5RP3AKU\Jisol
2023-11-05 03:26:09 +08:00
parent ec4d6a15d7
commit 0014eff5e0
4034 changed files with 623229 additions and 41 deletions

View File

@@ -0,0 +1,39 @@
import { ProgressBar } from "cc";
import { _decorator } from "cc";
import { JNGLayerBase, app } from "../../App";
import { Label } from "cc";
import { GUI } from "../UIConfig";
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 app.layer.Open(GUI.Home);
//关闭加载页
app.layer.Close(GUI.Loading);
}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "7b00aff8-c844-4bfc-b808-e19a1bc4f02c",
"files": [],
"subMetas": {},
"userData": {}
}