Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
middleLayer_for_debug
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
middleLayer_for_debug
Commits
aed34cf9
Commit
aed34cf9
authored
Dec 06, 2021
by
liujiangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debug
parent
7d614709
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
40 deletions
+1
-40
air.js
assets/middleLayer_for_debug/script/air.js
+0
-33
middleLayer.js
assets/middleLayer_for_debug/script/middleLayer.js
+1
-7
No files found.
assets/middleLayer_for_debug/script/air.js
View file @
aed34cf9
...
@@ -189,36 +189,3 @@ export function initAir(_this) {
...
@@ -189,36 +189,3 @@ export function initAir(_this) {
};
};
}
}
export
function
timerManager
()
{
window
.
timerManager
=
{};
for
(
let
i
=
0
;
i
<
20
;
i
++
){
window
.
timerManager
[
`timer
${
i
}
`
]
=
{
handler
:
null
,
type
:
null
,
};
}
window
.
freeAllTimeInterval
=
function
(){
console
.
log
(
"
===liu===des==freeAll
"
);
for
(
const
key
in
window
.
timerManager
)
{
const
obj
=
window
.
timerManager
[
key
];
console
.
log
(
"
===liu===des==
"
,
obj
.
handler
,
obj
.
type
);
if
(
obj
.
handler
){
window
[
obj
.
type
](
obj
.
handler
);
}
}
}
return
{
freeAll
()
{
console
.
log
(
"
===liu=====freeAll
"
);
for
(
const
key
in
window
.
timerManager
)
{
const
obj
=
window
.
timerManager
[
key
];
console
.
log
(
"
===liu=====
"
,
obj
.
handler
,
obj
.
type
);
if
(
obj
.
handler
){
window
[
obj
.
type
](
obj
.
handler
);
}
}
}
}
}
assets/middleLayer_for_debug/script/middleLayer.js
View file @
aed34cf9
import
{
initAir
,
timerManager
}
from
'
./air
'
;
import
{
initAir
}
from
'
./air
'
;
cc
.
Class
({
cc
.
Class
({
extends
:
cc
.
Component
,
extends
:
cc
.
Component
,
properties
:
{
properties
:
{
...
@@ -45,12 +45,10 @@ cc.Class({
...
@@ -45,12 +45,10 @@ cc.Class({
loadedCount
:
null
,
loadedCount
:
null
,
// 统一释放异步资源的方法
// 统一释放异步资源的方法
freeAll
:
null
,
onLoad
()
{
onLoad
()
{
this
.
preloadCount
=
0
;
this
.
preloadCount
=
0
;
this
.
loadedCount
=
0
;
this
.
loadedCount
=
0
;
initAir
(
this
);
initAir
(
this
);
this
.
freeAll
=
timerManager
().
freeAll
;
// this.preloadAll();
// this.preloadAll();
},
},
...
@@ -137,7 +135,6 @@ cc.Class({
...
@@ -137,7 +135,6 @@ cc.Class({
cc
.
assetManager
.
loadBundle
(
scene
.
bondleUrl
,
{
version
:
scene
.
version
},
(
err
,
bundle
)
=>
{
cc
.
assetManager
.
loadBundle
(
scene
.
bondleUrl
,
{
version
:
scene
.
version
},
(
err
,
bundle
)
=>
{
console
.
log
(
`
${
scene
.
bondleUrl
}
---场景开始loadBundle----`
);
console
.
log
(
`
${
scene
.
bondleUrl
}
---场景开始loadBundle----`
);
if
(
!
bundle
)
{
if
(
!
bundle
)
{
console
.
log
(
"
=====liu=======
"
,
JSON
.
stringify
(
err
));
_this
.
loadedCount
++
;
_this
.
loadedCount
++
;
_this
.
updateProcessBar
();
_this
.
updateProcessBar
();
i
++
;
i
++
;
...
@@ -222,9 +219,6 @@ cc.Class({
...
@@ -222,9 +219,6 @@ cc.Class({
.
call
(()
=>
{
.
call
(()
=>
{
exitBtn
.
active
=
false
;
exitBtn
.
active
=
false
;
cc
.
game
.
removePersistRootNode
(
this
.
node
);
cc
.
game
.
removePersistRootNode
(
this
.
node
);
console
.
log
(
"
======mid========
"
);
this
.
freeAll
();
console
.
log
(
"
======mid1========
"
);
cc
.
director
.
getScene
().
destroy
();
cc
.
director
.
getScene
().
destroy
();
cc
.
director
.
loadScene
(
"
debug_shell
"
,
null
,
null
,
(
err
,
scene
)
=>
{
cc
.
director
.
loadScene
(
"
debug_shell
"
,
null
,
null
,
(
err
,
scene
)
=>
{
...
...
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