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,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "65c8ddaf-bdfa-4c52-bcef-f952bf687165",
"files": [],
"subMetas": {},
"userData": {}
}

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": {}
}

View File

@@ -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)}
},
},
}