mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
update
This commit is contained in:
39
JisolGameCocos/assets/script/ui/Loading/LoadingView.ts
Normal file
39
JisolGameCocos/assets/script/ui/Loading/LoadingView.ts
Normal 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);
|
||||
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.23",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "7b00aff8-c844-4bfc-b808-e19a1bc4f02c",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
Reference in New Issue
Block a user