mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
update
This commit is contained in:
9
JisolGameCocos/assets/script/ui/Loading.meta
Normal file
9
JisolGameCocos/assets/script/ui/Loading.meta
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "1.2.0",
|
||||
"importer": "directory",
|
||||
"imported": true,
|
||||
"uuid": "65c8ddaf-bdfa-4c52-bcef-f952bf687165",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
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": {}
|
||||
}
|
@@ -1,14 +1,33 @@
|
||||
import { JNLayerInfo } from "../../../extensions/ngame/assets/ngame/ui/JNLayer";
|
||||
import { v3 } from "cc";
|
||||
import { JNLayerAnim, JNLayerInfo } from "../../../extensions/ngame/assets/ngame/ui/JNLayer";
|
||||
|
||||
export enum GLayer{
|
||||
View = "View",
|
||||
}
|
||||
|
||||
export enum GUI{
|
||||
Loading = "Loading",
|
||||
Home = "Home",
|
||||
}
|
||||
|
||||
export const UIConfig:{ [key: string]: JNLayerInfo; } = {
|
||||
[GUI.Home]:{ layer:GLayer.View, uri: "prefab/ui/Home/HomeView"}
|
||||
[GUI.Loading]:{
|
||||
layer:GLayer.View,
|
||||
uri: "prefab/ui/Loading/LoadingView",
|
||||
anims:{
|
||||
back:JNLayerAnim.Smaller,
|
||||
backInfo:{key:"position",start:v3(0,0,0),end:v3(-720,0,0)}
|
||||
},
|
||||
},
|
||||
[GUI.Home]:{
|
||||
layer:GLayer.View,
|
||||
uri: "prefab/ui/Home/HomeView",
|
||||
anims:{
|
||||
front:JNLayerAnim.Enlarge,
|
||||
back:JNLayerAnim.Smaller,
|
||||
frontInfo:{key:"position",start:v3(720,0,0),end:v3(0,0,0)},
|
||||
backInfo:{key:"position",start:v3(0,0,0),end:v3(-720,0,0)}
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user