Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zeroing-engine
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
劳工
zeroing-engine
Commits
ce32f4ac
Commit
ce32f4ac
authored
May 13, 2020
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复自定义模块链接的素材加载不到的问题
parent
0d95aa07
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
21 deletions
+30
-21
assets-manager.ts
src/zeroing/game-warpper/assets-manager.ts
+30
-21
No files found.
src/zeroing/game-warpper/assets-manager.ts
View file @
ce32f4ac
...
...
@@ -61,7 +61,7 @@ export async function loadAssetsGroups(groups, onStart?, onFinish?) {
await
loadAssetsGroup
(
depAssets
,
groupName
,
()
=>
{
loaded
++
;
globalEvent
.
dispatchEvent
(
'load-assets-process'
,
{
loaded
,
total
})
},
()
=>
{
},
()
=>
{
globalEvent
.
dispatchEvent
(
'load-assets-complete'
);
});
}
...
...
@@ -113,14 +113,16 @@ export function loadAssets(config, onProgress?, onComplete?) {
return
Promise
.
all
(
config
.
map
(
assetConfig
=>
{
assetsConfig
.
push
(
assetConfig
);
if
(
assetConfig
.
url
.
indexOf
(
linkScheme
)
===
0
)
{
let
linkUUID
=
assetConfig
.
url
.
replace
(
linkScheme
,
''
);
assetConfig
=
getAssetByUUID
(
linkUUID
);
}
if
(
assetConfig
)
{
const
{
url
,
ext
,
uuid
}
=
assetConfig
;
const
loadFunc
=
loaderMapping
[
ext
];
if
(
loadFunc
)
{
if
(
url
.
indexOf
(
linkScheme
)
===
0
)
{
loaded
++
;
onProgress
&&
onProgress
(
loaded
,
total
);
return
Promise
.
resolve
();
}
let
method
=
globalLoader
[
'load'
+
loadFunc
];
return
method
.
call
(
globalLoader
,
url
,
uuid
).
then
(
(
data
)
=>
{
...
...
@@ -134,6 +136,13 @@ export function loadAssets(config, onProgress?, onComplete?) {
}
);
}
else
{
return
p
();
}
}
else
{
return
p
();
}
function
p
()
{
loaded
++
;
onProgress
&&
onProgress
(
loaded
,
total
);
return
Promise
.
resolve
();
...
...
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