Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OP08_1
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
template admin
OP08_1
Commits
f621615d
Commit
f621615d
authored
Sep 28, 2021
by
范雪寒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: preload方法修改
parent
58307637
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
4 deletions
+19
-4
scene.js
play/assets/scene/scene/scene.js
+19
-4
No files found.
play/assets/scene/scene/scene.js
View file @
f621615d
...
...
@@ -111,13 +111,23 @@ cc.Class({
},
preload
()
{
const
preloadArr
=
this
.
_imageResList
.
concat
(
this
.
_audioResList
).
concat
(
this
.
_animaResList
);
const
preloadArr
=
[
...
this
.
_imageResList
,
...
this
.
_audioResList
,
...
this
.
_animaResList
];
cc
.
assetManager
.
loadAny
(
preloadArr
,
null
,
null
,
(
err
,
data
)
=>
{
this
.
loadEnd
();
if
(
window
&&
window
[
"
air
"
])
{
window
[
"
air
"
].
hideAirClassLoading
();
cc
.
find
(
'
Canvas
'
).
opacity
=
0
;
window
.
air
.
onCourseInScreen
=
(
next
)
=>
{
cc
.
find
(
'
Canvas
'
).
opacity
=
255
;
this
.
loadEnd
();
next
();
}
window
.
air
.
hideAirClassLoading
();
}
else
{
this
.
loadEnd
();
}
cc
.
debug
.
setDisplayStats
(
false
);
...
...
@@ -125,6 +135,7 @@ cc.Class({
},
loadEnd
()
{
this
.
initData
();
this
.
initAudio
();
...
...
@@ -298,6 +309,10 @@ cc.Class({
onDestroy
()
{
// 在此处释放setTimeout、setInterval等异步方法
// 在此处停止非cc.audioEngine的音频播放
},
...
...
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