Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
DuibaGameTemplate
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
钱根
DuibaGameTemplate
Commits
f40a872d
Commit
f40a872d
authored
Feb 11, 2022
by
Master Q
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
onPreloadAllGroup resource
parent
f95898a6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
Main.ts
src/Main.ts
+11
-0
No files found.
src/Main.ts
View file @
f40a872d
...
@@ -147,6 +147,16 @@ export class Main {
...
@@ -147,6 +147,16 @@ export class Main {
// destroyWebNetData()
// destroyWebNetData()
}
}
public
static
async
onPreloadResource
()
{
return
new
Promise
<
void
>
(
async
(
r
)
=>
{
RES
.
loadConfig
(
ResJson
);
// 皮肤配置加载
RES
.
loadSkinConfig
(
SkinJson
);
await
RES
.
loadAllGroup
()
r
()
})
}
private
async
onAddToStage
()
{
private
async
onAddToStage
()
{
//初始化层级
//初始化层级
layers
.
init
(
this
.
stage
);
layers
.
init
(
this
.
stage
);
...
@@ -159,6 +169,7 @@ export class Main {
...
@@ -159,6 +169,7 @@ export class Main {
console
.
log
(
"初始化皮肤配置完成"
)
console
.
log
(
"初始化皮肤配置完成"
)
// 加载通用资源
// 加载通用资源
await
RES
.
loadGroup
(
"common"
);
await
RES
.
loadGroup
(
"common"
);
RES
.
loadAllGroup
()
console
.
log
(
"通用资源加载完成"
)
console
.
log
(
"通用资源加载完成"
)
// h5环境时,隐藏加载中
// h5环境时,隐藏加载中
if
(
FYGE
.
getEnv
()
==
"web"
&&
document
.
getElementById
(
"__loading__"
))
document
.
getElementById
(
"__loading__"
).
style
.
display
=
"none"
;
if
(
FYGE
.
getEnv
()
==
"web"
&&
document
.
getElementById
(
"__loading__"
))
document
.
getElementById
(
"__loading__"
).
style
.
display
=
"none"
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment